[Gambas-user] Me.Close not working as expected

Charlie Ogier charlie at cogier.com
Thu Jul 1 18:37:52 CEST 2021


Hi,

Can you try this code and see if you experience my problem. The program 
should end on clicking the button, but it doesn't close until the end of 
the 'Sub'.

Thanks,

Charlie

***Code***
Button1 As Button

Public Sub Form_Open()

   With Me
     .Height = 400
     .Width = 500
     .Padding = 5
     .Center
   End With

   With Button1 = New Button(Me) As "Button1"
     .W = 100
     .H = 28
     .X = 10
     .Y = 10
     .Text = "&Click me!"
   End With

End

Public Sub Button1_Click()

   Dim iLoop As Integer

   Me.Close '' Shouldn't the program stop here?

   For iLoop = 0 To 1000
     Print Str(iLoop) & " Hello"
   Next

End

***End code***


More information about the User mailing list