click event not firing if lost_focus is firing first 
Author Message
 click event not firing if lost_focus is firing first
I have a form with a combobox and a command button.  When I click the
command button while the focus is on the combobox, the lost_focus event
is fired on the combobox, but the click event is not fired on the
command button.  I have to click the button a second time to fire the
click event.  Is there a way to get both events to fire without having
to click the button twice?

Gina Cresse




Mon, 01 Jul 2002 03:00:00 GMT  
 click event not firing if lost_focus is firing first
  Try using the validate event instead of the lostfocus event.  I think
validate was made for such situations.
  Good luck,
  Benji Cohen
Quote:

> I have a form with a combobox and a command button.  When I click the
> command button while the focus is on the combobox, the lost_focus event
> is fired on the combobox, but the click event is not fired on the
> command button.  I have to click the button a second time to fire the
> click event.  Is there a way to get both events to fire without having
> to click the button twice?

> Gina Cresse




Tue, 02 Jul 2002 03:00:00 GMT  
 click event not firing if lost_focus is firing first
  Try using the validate event instead of the lostfocus event.  I think
validate was made for such situations.
  Good luck,
  Benji Cohen
Quote:

> I have a form with a combobox and a command button.  When I click the
> command button while the focus is on the combobox, the lost_focus event
> is fired on the combobox, but the click event is not fired on the
> command button.  I have to click the button a second time to fire the
> click event.  Is there a way to get both events to fire without having
> to click the button twice?

> Gina Cresse




Tue, 02 Jul 2002 03:00:00 GMT  
 click event not firing if lost_focus is firing first
  Try using the validate event instead of the lostfocus event.  I think
validate was made for such situations.
  Good luck,
  Benji Cohen
Quote:

> I have a form with a combobox and a command button.  When I click the
> command button while the focus is on the combobox, the lost_focus event
> is fired on the combobox, but the click event is not fired on the
> command button.  I have to click the button a second time to fire the
> click event.  Is there a way to get both events to fire without having
> to click the button twice?

> Gina Cresse




Tue, 02 Jul 2002 03:00:00 GMT  
 click event not firing if lost_focus is firing first

Quote:

> I have a form with a combobox and a command button.  When I click the
> command button while the focus is on the combobox, the lost_focus event
> is fired on the combobox, but the click event is not fired on the
> command button.  I have to click the button a second time to fire the
> click event.  Is there a way to get both events to fire without having
> to click the button twice?

I was unable to reproduce your problem. I started a new standard exe project
with one form containing one combobox and one command button. I then added
this code to the form:

Private Sub Combo1_LostFocus()
  Debug.Print "Combo1_LostFocus()"
End Sub

Private Sub Command1_Click()
  Debug.Print "Command1_Click()"
End Sub

The immediate window reported both events every time, even if the app had to
be activated first, eg. some other app was activated befor clicking the
button.

What do you have in your lostfocus event?
Maybe this code is preventing the button's click event to be fired.

Svein H



Tue, 02 Jul 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. First Click In UserControl DataGrid Does Not Fire An Event

2. Click-Event does not fire

3. combo box Click event not firing

4. Button Click Event Not Firing !

5. ESC still fires Validating events but clicking the Cancel button does not

6. Click and MouseUp events not firing

7. TreeView Not firing click event

8. Lost_focus event After/First CommandButton Click

9. Lost_focus event After/First CommandButton Click

10. Lost_focus event After/First CommandButton Click

11. System tray icon, single click event fires before double click

12. Form Activate Event fails to fire first time in form

 

 
Powered by phpBB® Forum Software