Re: setfocus() endless loop
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Tue, 24 Apr 2007 20:38:47 -0400
Yes, this is a known problem. The easiest way to avoid it is to not set focus to a
disabled control. It is very annoying. Worse still, if you are deactivating a control
that has the focus, life becomes more confused, although the program does not actually
hang.
joe
On Mon, 23 Apr 2007 03:40:00 -0700, vKey <vKey@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I've got two dialogs, one embedded within the other. I'd like to set theJoseph M. Newcomer [MVP]
focus on a Edit-control of the embedded dialog, by calling setFocus() in
onInitDialog() (return FALSE) of the embedded dialog. This works fine so far,
as long as the edit fields of both dialogs are activ.
However, when the edit controls are set inactiv, the application gets stuck
and the cursor is blinking in a control of the outer dialog, although it is
never set there in the code. If I remove the desired setFocus(), everything
works fine, also with inactiv controls.
Probably, the setFocus() on the desired edit control is causing an endless
loop. Can anyone help, how to fix the problem?
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Prev by Date: Re: How to write a custom control in MFC ??
- Next by Date: Re: grid
- Previous by thread: Re: setfocus() endless loop
- Next by thread: Re: setfocus() endless loop
- Index(es):
Relevant Pages
|