Yes the fact that they are asynchornous is the problem.
With the list box disabled a double click is generated and the DoubleClick event code runs as soon as the method executing when the unwanted double click occurs finishes. I am trying to stop that second double click from running the DoubleClick event code…
Double Click Event code…
[code]if cbSendURLLink.Value then
ProgressWheel1.HorizontalCenter = cnt_emailURLs1.HorizontalCenter
ProgressWheel1.VerticalCenter = cnt_emailURLs1.VerticalCenter
ProgressWheel1.Visible=true
FolderChangeInProgress = true
cnt_emailURLs1.enableDisableControls(false)
enableDisableControls(false) //disables the list box among other controls
timer1.Mode = Timer.ModeSingle
//need to use a timer to show the Progress Wheel and disable the list box and other controls
//while the timer code is running the http request.
end if[/code]
Timer code…
[code]me.Mode = timer.ModeOff
//Code to initialize everything for the http request
//during all this time all the controls I do not want usable are disabled
//…
//…
DIM data As string = socket1.Post(“http://”+Host+"/chaos/UploadToAWSOnly?output=xml&site=xojo", 45)
data = defineEncoding(data, encodings.UTF8)
//Code to digest the returned data
//…
//…
//…
ProgressWheel1.Visible=false
cnt_emailURLs1.enableDisableControls(true)
enableDisableControls(true) //listbox along with other controls get enabled
//At this point if the user had indavetantly double clicked the list box while the timer code was runing, the On Double Click event unnecessarily runs again. In fact it doesn’t matter if the list box is disabled or enabled, the On Double Click event code runs.[/code]
The problem is that if the user double clicks a row in the listbox while it is disabled, the Double Click sends another http request as soon as the timer code finishes. Usally the unwanted double click is a mistake by the user or a user not thinking that they in fact double clicked a row. In any case, the unwanted double click creates a miriad of problems in both the running WebApp and the database back end.
I have to figure out how to keep the code in the On DoubleClick event of the list box from running when an uwanted double click occurs while the list box is disabled. I tried using a varible that is set to true if double clicks are not allowed but I can’t get it set before the unwanted double click event is executed.