I have a timing issue on clicking a ButtonGadget and disabling another ButtonGadget.
For simple means, I have a window with 2 Button Gadgets ("Connect A" and "Connect B"). When I click on one of the buttons ("Connect A") I want to disable the other button ("Connect B") and then preform a Network Connection
What is happening is that when I click the "Connect A" button the command to disable the "Connect B" button is delayed until the network connection has actually finished, which can be up to 3 seconds.
In my Select statements for the "Connect A" Button I have.
Code: Select all
DisableGadget(MainWindow_Button_ConnectB,1)
ConnectionID = OpenNetworkConnection("127.0.0.1", Port)
UpdateWindow_(GadgetID(MainWindow_Button_ConnectB))
before the network connection but the disabling is still delayed.
So I added a DoEvents procedure before the network connection but the disabling is still delayed.
Is there a way to disable the "Connect B" button and then run the network connection once the button has actually been disabled.
Thanks