Forcing cursur to stay in CEdit
-
Hi, This is actually a second part to a previous option. Assuming I "caught" the VK_TAB in PreTranslateMessage function of my custom CEdit control and did what I want. Now, how do I force the cursor to stay at the end of the line inside my CEdit control. right now, after I am done processing the VK_TAB, the focus goes to the next control. I want to prevent that. I tried SetFocus and return w/o running the CEdit::PreTranslateMessage after my processing but that did not help. Thank.
-
Hi, This is actually a second part to a previous option. Assuming I "caught" the VK_TAB in PreTranslateMessage function of my custom CEdit control and did what I want. Now, how do I force the cursor to stay at the end of the line inside my CEdit control. right now, after I am done processing the VK_TAB, the focus goes to the next control. I want to prevent that. I tried SetFocus and return w/o running the CEdit::PreTranslateMessage after my processing but that did not help. Thank.
from MSDN Pretran
CWnd::PreTranslateMessage
virtual BOOL PreTranslateMessage( MSG* pMsg );
Return Value
Nonzero if the message was translated and should not be dispatched;
0 if the message was not translated and should be dispatched.Hence you have simply make your
PreTranslateMessage
implemantation to return 0 when Tab is intercepted. :) -- modified at 13:26 Monday 8th January, 2007If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
-
from MSDN Pretran
CWnd::PreTranslateMessage
virtual BOOL PreTranslateMessage( MSG* pMsg );
Return Value
Nonzero if the message was translated and should not be dispatched;
0 if the message was not translated and should be dispatched.Hence you have simply make your
PreTranslateMessage
implemantation to return 0 when Tab is intercepted. :) -- modified at 13:26 Monday 8th January, 2007If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
please don't use the <pre> tag to quote long sentences. this enforce the page to display the line till the end, requiering us to scroll then...
Don't know where to start ?
Refer the Forums Guidelines and ask a friend -
please don't use the <pre> tag to quote long sentences. this enforce the page to display the line till the end, requiering us to scroll then...
Don't know where to start ?
Refer the Forums Guidelines and ask a friend