MessageBox button Error
Quote from Gowtham on April 14, 2022, 12:44 pmour method works fine. However, it's rather complex for what should be solvable by a simpler idea (i.e. using the Lock method). I've emailed Gambas Lists about the Lock method. It will be interesting to see the results. When Benoît looks at these things, he soon spots whether I've got it wrong or whether I have a valid point (e.g. he corrected the coding for the Database object not working after I clarified the problem).
I've just thought of another way round the problem: using the Observe object (as detailed in ). The example on that webpage uses the following coding:
Private $hButton As Button
Private $hObserver As ObserverPublic Sub Form_Open()
$hButton = New Button(Me) As "Button"
$hButton.Text = "&Click"
$hButton.Height = 28
$hButton.Width = 80
$hObserver = New Observer($hButton) As "Observer"End
Public Sub Observer_Click()
Debug "The button has been clicked. I have cancelled the event!"
Stop EventEnd
Public Sub Button_Click()
Debug "If you see me this is a bug!"
End
It does have the merit of not having to create another form to emulate MessageBox! Obviously, the Observe control created has to be 'removed' (yet something else I don't yet know how to do)!
our method works fine. However, it's rather complex for what should be solvable by a simpler idea (i.e. using the Lock method). I've emailed Gambas Lists about the Lock method. It will be interesting to see the results. When Benoît looks at these things, he soon spots whether I've got it wrong or whether I have a valid point (e.g. he corrected the coding for the Database object not working after I clarified the problem).
I've just thought of another way round the problem: using the Observe object (as detailed in ). The example on that webpage uses the following coding:
Private $hButton As Button
Private $hObserver As ObserverPublic Sub Form_Open()
$hButton = New Button(Me) As "Button"
$hButton.Text = "&Click"
$hButton.Height = 28
$hButton.Width = 80
$hObserver = New Observer($hButton) As "Observer"End
Public Sub Observer_Click()
Debug "The button has been clicked. I have cancelled the event!"
Stop EventEnd
Public Sub Button_Click()
Debug "If you see me this is a bug!"
End