Hi all,I ran into a rather strange problem.I created a usercontrol that hosts an UltraMaskedEditor control.
This editor is set as ActiveControl and after that I call the editor.Focus() method.
The editor is focused (test is selected) but when I start typing it always skipps the first character I type...So if I type "FUBAR" it only displays "UBAR"...
Am I doing something wrong here?Any help is kindly appreciated.
Cheers and best regardsAndy
I just read a post from Mike Saltzman that setting the focus on a control via the Focus() Method does not work until the control is actually shown...So in this case my control is focused because its' TabIndex is 0
Still the behavior is the same as described above.
In my case I am dealing with a wizard step that has a AfterWizardPageIsShown event which I used to focus the UltraMaskedEditor.Unfortunately it still skips the first character I type...
I figured out that it has nothing to do with the editor control.Every interaction skips the first step...For example if I press the TAB key it only responds to the second press and starts switching controls.
Sorry for bothering...
Anyway, if someone knows whats going on I would be happy to hear about it ;)
Hello,
I must be missing something in your scenario because I am not able to reproduce it. Please take a look at my sample and modify it so it reproduces the issue.
I will be happy to assist you further on that matter.
Hi Boris,I investigated this problem further and can pinpoint it to the following.
In windows it is possible to add "&" to the text of a button to get it underlined so people can press ALT-N for the "&New" button.
By default the character "N" is not underlined until you press ALT the first time. After you have pressed ALT the first time all underlines appear on the buttons.
In order to see all underlines on buttons my wizard app sent "%" via
SendKeys.Send("%") which mimics the ALT keypress.
After that the focus is taken away from the usercontrol causing the above mentioned behavior.
I tried to refocus the usercontrol after the key is sent, but it still behaves the same.
This is absolutely no Infragistics problem, it happens also to the general windows buttons.I am going to figure it out ;)
Have a great week and thanks for trying to help me out on this,Andy
In order to complete this just in case somebody is interested...
I needed to do the following, which actually makes sense :)
SendKeys.Send("%");SendKeys.Send("{ESC}");
The ESC allows the control to gain focus again, so everything is fine now.
Thank you for your feedback and for sharing this with us. We believe that the other community members could benefit from such threads.
Please feel free to let me know if a question about our toolset comes up on your mind.