Showing a form in a SelectionChanged event

Discussion in 'Questions (Windows Mobile)' started by specci48, May 18, 2007.

  1. specci48

    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
     
  2. Erel

    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
     
  3. Cableguy

    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...
     
  4. specci48

    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
     
Loading...