Hi
I have 2 forms (A and B), when I am using Forma A I call form B Modal , but when I did a double click in Form B It too click in button in form A . how to prevent click on the form below (A) ?
Tia
Printable View
Hi
I have 2 forms (A and B), when I am using Forma A I call form B Modal , but when I did a double click in Form B It too click in button in form A . how to prevent click on the form below (A) ?
Tia
Should work:
Clicking a command button on Form1:
Clicking a command button on Form2:Code:Private sub Command1_Click()
Form1.Enabled = False
Form2.Show
End Sub
Code:Private sub Command1_Click()
Form1.Enabled = True
Form2.Hide
End Sub
me again
work fine when I tried to click in form1 when Form2 is actiive (It did to let), but when I clicked in control in Form2 , It too clicked in control in form1
Attachment 115899
me again
work fine when I tried to click in form1 when Form2 is actiive (It did to let), but when I clicked in control in Form2 , It too clicked in control in form1
Attachment 115899
I have ran into this issue on handheld devices in the past where the top form unloaded and the click passed through to the bottom form which just happened to have a control at that position.
I did not go into it very far, my solution was to add a timer control to the form that would enable the form
So when second form is loaded set the enabled property to false on the first form then when second from is unloaded enabled the timer.
In the timer tick event enable the first form again. I generally use a timer interval of 100 for something like this which gives you 1/10th second delay between form2 closing and form1 being enabled which is enough time to prevent the click from passing through but not so much that the user notices the form being disabled when they return to it.
a bit off-topic here, but i find myself doing the timer thingy as well, but to me its kind of unclean, bulky way, to approach to an issue.
Anyone got a different idea to efficiently execute a one-time delayed sub, without adding a timer to the form ?
(excluding the messy unstable Sleep and DoEvents technique).
I agree it is a bit of a hack in this instance, I was in a rush to solve an issue when i came up with this method.
I have not however had this issue in any PC based programs, only a handheld app and it only happen in one spot there. The way the app was designed the Exit button was directly behind the button to return to the main menu and when a user touched the screen to return to the menu it would sometimes trigger the exit button and close the app which was a nuisance to say the least.
This really should not happen with a mouse click unless of course there is some issue with the mouse or you have a user like my wife who will click 3 or 4 times real quick.
That said using a timer to run a delayed piece of code is perfectly acceptable. Using 5 or 10 of them for this type of thing is not