[Gambas-user] Me.Close not working as expected
bsteers4 at gmail.com
Thu Jul 1 19:58:11 CEST 2021
On Thu, 1 Jul 2021 at 17:59, Charlie Ogier <charlie at cogier.com> wrote:
> 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'.
> Button1 As Button
> Public Sub Form_Open()
> With Me
> .Height = 400
> .Width = 500
> .Padding = 5
> End With
> With Button1 = New Button(Me) As "Button1"
> .W = 100
> .H = 28
> .X = 10
> .Y = 10
> .Text = "&Click me!"
> End With
> 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"
> ***End code***
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
Maybe it's because you're inside an event already.
Maybe Button1_Click event has to finish before the form can close.
so does this work as expected..
Me.Close ' trigger close event
Return ' exit the current event
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the User