EditBox with focus but no cursor [modified]
-
Doesn't come back even if you move the mouse?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
No it's most strange - I can select text (and it gets higlighted) but there is no way of knowing where the cursor is (and the edit box is enabled, typing works!) . The only thing that works is to give the focus to another control (with mouse or tab) and then come back to it... strangest thing I have seen in a while!
-
No it's most strange - I can select text (and it gets higlighted) but there is no way of knowing where the cursor is (and the edit box is enabled, typing works!) . The only thing that works is to give the focus to another control (with mouse or tab) and then come back to it... strangest thing I have seen in a while!
3 questions: 1. Is the edit box customized in any way or is it just the default edit box? So did you overwrite any message handlers like WM_SETCURSOR or maybe WM_CHAR? 2. Does the cursor disappear when you start typing only or when you move the mouse cursor over your edit or maybe TAB to it? 3. Does this happen if you don't use your own cursor?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
-
3 questions: 1. Is the edit box customized in any way or is it just the default edit box? So did you overwrite any message handlers like WM_SETCURSOR or maybe WM_CHAR? 2. Does the cursor disappear when you start typing only or when you move the mouse cursor over your edit or maybe TAB to it? 3. Does this happen if you don't use your own cursor?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
Thanks for taking the time to answer by the way! 1) No it's a simple CEdit... I did override WM_KEYDOWN (with PreTranslateMessage in the parent window)... I am doing a custom control where you can view some html and view the source code... and switch with a custom tab control from one to the other. Hoping I make sense... 2) The cursor disappears when the user clicks on the tab control... it hides the other window, displays the edit, gives it focus and voila - you can type but you have no idea where you are 3) Not sure I understand... do you want me to change the cursor? I certainly have not changed it manually so far
-
Thanks for taking the time to answer by the way! 1) No it's a simple CEdit... I did override WM_KEYDOWN (with PreTranslateMessage in the parent window)... I am doing a custom control where you can view some html and view the source code... and switch with a custom tab control from one to the other. Hoping I make sense... 2) The cursor disappears when the user clicks on the tab control... it hides the other window, displays the edit, gives it focus and voila - you can type but you have no idea where you are 3) Not sure I understand... do you want me to change the cursor? I certainly have not changed it manually so far
Ah, i think i see the confusement here, when i hear cursor i think of the mouse cursor, while you are talking about the caret, right? The little blinking line that shows where you type...Are you sure the control receives the WM_SETFOCUS message when it gets the focus?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
-
Ah, i think i see the confusement here, when i hear cursor i think of the mouse cursor, while you are talking about the caret, right? The little blinking line that shows where you type...Are you sure the control receives the WM_SETFOCUS message when it gets the focus?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
of course you're right - it's called the caret and not the cursor... my mistake. Yes the control does get the focus: when I type, it gets updated... The temporary fix I have done is to give the focus to the tab control and then with a timer give it back to the edit... madness but at least it works... most bizarre
-
of course you're right - it's called the caret and not the cursor... my mistake. Yes the control does get the focus: when I type, it gets updated... The temporary fix I have done is to give the focus to the tab control and then with a timer give it back to the edit... madness but at least it works... most bizarre
I have seen this happening too but i can't remember anymore what the problem actually was... :( If you hit the ALT key, do you maybe see the focus rect appearing on the tab control? I have seen strange behaviour appearing when setting the focus in an unapropriate time. I think you could simply use PostMessage to overcome this, so no need for a timer. Try posting (not sending) WM_SETFOCUS to the edit when it has been shown, or maybe post a custom message (like WM_USER) to the tab control which will set the focus on the shown page when it receives it. (I'd try the later aproach)
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
-
I am trying to build this custom control - one of the child windows is an edit control and at one point it gets the focus (you can type in it) but the cursor has disappeared... what could cause this and how can I fix this? Thanks in advance
modified on Monday, December 8, 2008 9:43 AM
-
Are you using CreateSolidCaret. Does your custom edit control use an offscreen memory buffer for drawing?
-
No (CreateSolidCaret) and no (memory buffer)... it's is a simple MFC CEdit with no customisation whatsoever... it's simply a child window of a CWnd derived control!
In your initial comment you stated, "I am trying to build this custom cursor" and later you clarified that you meant "caret" so I naturally assumed you were creating a custom "caret" but apparently not so just ignore my question. I apologize for misunderstanding.
-
In your initial comment you stated, "I am trying to build this custom cursor" and later you clarified that you meant "caret" so I naturally assumed you were creating a custom "caret" but apparently not so just ignore my question. I apologize for misunderstanding.