[Message Deleted]
-
ensger wrote:
Your example-program doesn't show how to set the focus to the grid
Is it... different from the method used to set focus to every other window or control? :~ BTW - each article has a forum associated with it. That's the place for comments like this.
----
...the wind blows over it and it is gone, and its place remembers it no more...
-
It took you a week to solve the problem, and then you dumped it.
Cheers Garth Some days it's not even worth chewing through the restraints
-
ensger wrote:
Your example-program doesn't show how to set the focus to the grid
Is it... different from the method used to set focus to every other window or control? :~ BTW - each article has a forum associated with it. That's the place for comments like this.
----
...the wind blows over it and it is gone, and its place remembers it no more...
Set focus in this case is dificult for me, as i'm not a programmer but a commercial who's anly programming a few hours a week. And I hope it's obvious that I am thankful for Chris work and this message was only a question because I know, that others have the same problem. Hope, I didn't realy disturb anybody with this, Gerhard
-
It took you a week to solve the problem, and then you dumped it.
Cheers Garth Some days it's not even worth chewing through the restraints
-
Set focus in this case is dificult for me, as i'm not a programmer but a commercial who's anly programming a few hours a week. And I hope it's obvious that I am thankful for Chris work and this message was only a question because I know, that others have the same problem. Hope, I didn't realy disturb anybody with this, Gerhard
ensger wrote:
Set focus in this case is dificult for me, as i'm not a programmer but a commercial who's anly programming a few hours a week.
Right, i'm just saying -
::SetFocus()
works for any window, and any control (with the exception of odd ducks like windowless controls). You learn it for a button, you use it for a list / grid / whatever. So the post struck me as odd - like driving from Minnesota into Iowa, and seeing a roadsign describing the process for breathing Iowa air. Eh, ignore me, i've been mixing cold medicine. Glad you're having fun. ;)----
...the wind blows over it and it is gone, and its place remembers it no more...
-
ensger wrote:
Set focus in this case is dificult for me, as i'm not a programmer but a commercial who's anly programming a few hours a week.
Right, i'm just saying -
::SetFocus()
works for any window, and any control (with the exception of odd ducks like windowless controls). You learn it for a button, you use it for a list / grid / whatever. So the post struck me as odd - like driving from Minnesota into Iowa, and seeing a roadsign describing the process for breathing Iowa air. Eh, ignore me, i've been mixing cold medicine. Glad you're having fun. ;)----
...the wind blows over it and it is gone, and its place remembers it no more...
:laugh::laugh: m_pGridCtrl->SetFocus() was one of my first attempts - but it didn't work.I needed the help of Jon A. Jonson with something like
void CMyView::OnSetFocus(CWnd* pOldWnd) { CView::OnSetFocus(pOldWnd); if (m_pGridCtrl && IsWindow(m_pGridCtrl->m_hWnd)) { m_pGridCtrl->SetFocus(); int x = m_pGridCtrl->GetFixedColumnCount(); int y = m_pGridCtrl->GetFixedRowCount(); m_pGridCtrl->SetFocusCell (y,x); m_pGridCtrl->EnsureVisible(y,x); } }
And that's difficult for me:confused: -
:laugh::laugh: m_pGridCtrl->SetFocus() was one of my first attempts - but it didn't work.I needed the help of Jon A. Jonson with something like
void CMyView::OnSetFocus(CWnd* pOldWnd) { CView::OnSetFocus(pOldWnd); if (m_pGridCtrl && IsWindow(m_pGridCtrl->m_hWnd)) { m_pGridCtrl->SetFocus(); int x = m_pGridCtrl->GetFixedColumnCount(); int y = m_pGridCtrl->GetFixedRowCount(); m_pGridCtrl->SetFocusCell (y,x); m_pGridCtrl->EnsureVisible(y,x); } }
And that's difficult for me:confused: -
It seems like such a waste of time to spend a week trying to solve the problem, and when you finally do, you decide to stop using the control.
Cheers Garth Some days it's not even worth chewing through the restraints
-
Ah, so you're talking about setting focus to a cell within the grid. Figured there was probably more to it. :)
----
...the wind blows over it and it is gone, and its place remembers it no more...
However you say to it - I want to be able to sctoll within the view with the keyboard. And that at first creation, when I change the window, when I made something like 'AfxMessage', after contextmenue and so on. This all is not possible with the example-code of Chris. But it would help beginners like me so much!!!! This was my suggestion to him - of course, I can do now and I could say, that's enough. But I think, this is a real problem for beginners:rose: Hope, I didn't affront anyone with my message (I see the 1.0-voting:-D)
-
It seems like such a waste of time to spend a week trying to solve the problem, and when you finally do, you decide to stop using the control.
Cheers Garth Some days it's not even worth chewing through the restraints
-
However you say to it - I want to be able to sctoll within the view with the keyboard. And that at first creation, when I change the window, when I made something like 'AfxMessage', after contextmenue and so on. This all is not possible with the example-code of Chris. But it would help beginners like me so much!!!! This was my suggestion to him - of course, I can do now and I could say, that's enough. But I think, this is a real problem for beginners:rose: Hope, I didn't affront anyone with my message (I see the 1.0-voting:-D)
-
ensger wrote:
Hope, I didn't affront anyone with my message (I see the 1.0-voting:-D)
As i said, it's not really the proper forum.
----
...the wind blows over it and it is gone, and its place remembers it no more...
-
Best to post in the forum attached to the Grid control. Unfortunately I have zero time to devote to the control these days, but there are many others who can help.
cheers, Chris Maunder
CodeProject.com : C++ MVP
-
ensger wrote:
Set focus in this case is dificult for me, as i'm not a programmer but a commercial who's anly programming a few hours a week.
Right, i'm just saying -
::SetFocus()
works for any window, and any control (with the exception of odd ducks like windowless controls). You learn it for a button, you use it for a list / grid / whatever. So the post struck me as odd - like driving from Minnesota into Iowa, and seeing a roadsign describing the process for breathing Iowa air. Eh, ignore me, i've been mixing cold medicine. Glad you're having fun. ;)----
...the wind blows over it and it is gone, and its place remembers it no more...
Shog9 wrote:
the process for breathing Iowa air
They breath air in Iowa... Interesting... I never knew that! :-D
Upcoming events: * Edinburgh: Web Security Conference Day for Windows Developers (12th April) * Glasgow: Introduction to AJAX (2nd May), SQL Server, Mock Objects My website
-
Shog9 wrote:
the process for breathing Iowa air
They breath air in Iowa... Interesting... I never knew that! :-D
Upcoming events: * Edinburgh: Web Security Conference Day for Windows Developers (12th April) * Glasgow: Introduction to AJAX (2nd May), SQL Server, Mock Objects My website
-
Best to post in the forum attached to the Grid control. Unfortunately I have zero time to devote to the control these days, but there are many others who can help.
cheers, Chris Maunder
CodeProject.com : C++ MVP