Showing a form in a SelectionChanged event

specci48

Well-Known Member
Licensed User
Showing a(nother) form in a SelectionChanged event works fine on the desktop but on the device the form opens an rapidly closes again.
I remember a thread from the old forum where this behaviour was discussed. But I don't remember the solution :(
Was it a timer event with a different sub or something like that?

specci48
 

Erel

Administrator
Staff member
Licensed User
Yes, the solution is to use a timer to show the form.
Sub Table_SelectionChanged
...
Timer1.Interval = 10
Timer1.Enabled = true
End Sub

Sub Timer1_Tick
Timer1.Enabled = false
Form2.Show
End Sub
 

Cableguy

Expert
Licensed User
Hi Specci48

I remember that thread, I think it had something to do with the focus property of the control that fired the case select event...Try to set the focus on some control in the new form before showing it...
 

specci48

Well-Known Member
Licensed User
I tried the trick to set the focus on different controls without any success.
Now I'm using the timer event.

Thanks
specci48
 
Top