ClearFocus .... dangerous command?

Try to position a textfield within a window and put a ClearFocus-Command into the GotFocus-Event.

Now when you run the program a massegebox explains, that the Debugtest.exe doesn’t work any more and you have to terminate the program.

If there are other textfields with other events in the window, this might not occur, but it can when you try to click on such a textfield and afterwards it will happen.

Bug-report is already done.

[quote=187385:@Robert Blazek]Try to position a textfield within a window and put a ClearFocus-Command into the GotFocus-Event.

Now when you run the program a massegebox explains, that the Debugtest.exe doesn’t work any more and you have to terminate the program.

If there are other textfields with other events in the window, this might not occur, but it can when you try to click on such a textfield and afterwards it will happen.

Bug-report is already done.[/quote]

Just set Tab Stop off and the Windows crash will be gone. Probably due to some conflict between the event and the ClearFocus command.

Thanks Michael,

It also helps, if you make it conditional:

If x=true then Clearfocus end if
And x=true can be always true,

But this is nowhere documented. So I call it a bug.

Robert,
the part =true is not mandatory: you can use if x then

Note: I had to edit this post four times adding text to work-around a bug in the software. =true set as code at the line start is buggy.