yes bushmobile, i set all my label array so it only have one click code.
rack:
perhaps there is, we just don't know yet. :)
Printable View
yes bushmobile, i set all my label array so it only have one click code.
rack:
perhaps there is, we just don't know yet. :)
Check out this from vbAccelerator. It should allow you to do what you want.
bush, vbaccelerator method is using FORM.
While i'm trying to avoid using FORM :)
In your opinion, what is best method to popup window?
using FORM with show as modal or using object on the same FORM with combobox behaviour?
If your preferred method is using FORM how to avoid created so many FORM for each popup windows?
Add the attached module to your project. Now all you have todo is to add the following code to the click event of your button (when you want to show the Frame).You don't even have to set the Visible property of the Frame to True, everything is handled by the attached code which uses a hook to detect mouse operations within your application and it also subclasses your app to detect if another application gains focus. If the mouse is pressed anywhere inside your application the frame will be hidden, the same happens if your application loses focus.VB Code:
Private Sub Command1_Click() Call HookMouse(Me.hWnd, Frame1.hWnd) End Sub
To handle the Esc key set the KeyPreview property of the Form to True and add this code:VB Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyEscape Then UnhookMouse End If End Sub
it work like magic joacim :)
Thanks.