PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
OnClick preceding OnEnter
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
OnClick preceding OnEnter
![]() |
OnClick preceding OnEnter |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
VS 2005 w/SP1 / XP Pro w/all service packs
One of our forms has a Tab-control onto which is dynamically added a number of other controls. When the added controls are ComboBoxes or CheckListBoxes, their OnClick event is fired before their OnEnter. For other controls on the Tab (e.g. ListBox) the events occur in the expected order -- Enter and then Click. On other forms where the controls are added to a Tab-control at design-time, the Enter / Click also occur in the expected order. Does anyone have any idea why on this form the Click (and MouseClick) event would precede the Enter event? -- // Lee Silver // Information Concepts Inc. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Anyone have any thoughts on why OnClick would precede OnEnter?
Lee wrote: > VS 2005 w/SP1 / XP Pro w/all service packs > > One of our forms has a Tab-control onto which is dynamically added a > number of other controls. When the added controls are ComboBoxes or > CheckListBoxes, their OnClick event is fired before their OnEnter. For > other controls on the Tab (e.g. ListBox) the events occur in the > expected order -- Enter and then Click. On other forms where the > controls are added to a Tab-control at design-time, the Enter / Click > also occur in the expected order. Does anyone have any idea why on this > form the Click (and MouseClick) event would precede the Enter event? > > -- > // Lee Silver > // Information Concepts Inc. |
|
|
|
#3 |
|
Guest
Posts: n/a
|
If I had to guess, it would be related to the differences between
setting focus on those controls versus other ones. -- Bryan Phillips MCSD, MCDBA, MCSE Blog: http://bphillips76.spaces.live.com "Lee" <lsilver@information-concepts.com> wrote in message news:1168515044.448053.93750@p59g2000hsd.googlegroups.com: > Anyone have any thoughts on why OnClick would precede OnEnter? > > Lee wrote: > > VS 2005 w/SP1 / XP Pro w/all service packs > > > > One of our forms has a Tab-control onto which is dynamically added a > > number of other controls. When the added controls are ComboBoxes or > > CheckListBoxes, their OnClick event is fired before their OnEnter. For > > other controls on the Tab (e.g. ListBox) the events occur in the > > expected order -- Enter and then Click. On other forms where the > > controls are added to a Tab-control at design-time, the Enter / Click > > also occur in the expected order. Does anyone have any idea why on this > > form the Click (and MouseClick) event would precede the Enter event? > > > > -- > > // Lee Silver > > // Information Concepts Inc. |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Bryan: In all cases we are setting focus by clicking on the control with the mouse. As a point of clarification... When I wrote OnClick and OnEnter I really meant the Enter and Click events; we are not overriding the the On*** methods. For a ComboBox the problem manifests itself as follows: The first time the control's selection-arrow is clicked nothing happens; the second and subsequent times click the selection-arrow causes the drop-down list to appear. The drop-down list should appear *every* time the selection-arrow is clicked. -- // Lee Silver // Information Concepts Inc. > If I had to guess, it would be related to the differences between > setting focus on those controls versus other ones. > > -- > Bryan Phillips > MCSD, MCDBA, MCSE > Blog: http://bphillips76.spaces.live.com > > > > "Lee" <lsilver@information-concepts.com> wrote in message > news:1168515044.448053.93750@p59g2000hsd.googlegroups.com: > > > Anyone have any thoughts on why OnClick would precede OnEnter? > > > > Lee wrote: > > > VS 2005 w/SP1 / XP Pro w/all service packs > > > > > > One of our forms has a Tab-control onto which is dynamically added a > > > number of other controls. When the added controls are ComboBoxes or > > > CheckListBoxes, their OnClick event is fired before their OnEnter. For > > > other controls on the Tab (e.g. ListBox) the events occur in the > > > expected order -- Enter and then Click. On other forms where the > > > controls are added to a Tab-control at design-time, the Enter / Click > > > also occur in the expected order. Does anyone have any idea why on this > > > form the Click (and MouseClick) event would precede the Enter event? > > > > > > -- > > > // Lee Silver > > > // Information Concepts Inc. |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Solution:
In the Click-event, if and only if the Enter-event has not been entered, set the DroppedDown property to True. -- // Lee Silver // Information Concepts Inc. Lee wrote: > Bryan: > > In all cases we are setting focus by clicking on the control with the > mouse. > > As a point of clarification... When I wrote OnClick and OnEnter I > really meant the Enter and Click events; we are not overriding the the > On*** methods. > > For a ComboBox the problem manifests itself as follows: The first time > the control's selection-arrow is clicked nothing happens; the second > and subsequent times click the selection-arrow causes the drop-down > list to appear. The drop-down list should appear *every* time the > selection-arrow is clicked. > > -- > // Lee Silver > // Information Concepts Inc. > > > If I had to guess, it would be related to the differences between > > setting focus on those controls versus other ones. > > > > -- > > Bryan Phillips > > MCSD, MCDBA, MCSE > > Blog: http://bphillips76.spaces.live.com > > > > > > > > "Lee" <lsilver@information-concepts.com> wrote in message > > news:1168515044.448053.93750@p59g2000hsd.googlegroups.com: > > > > > Anyone have any thoughts on why OnClick would precede OnEnter? > > > > > > Lee wrote: > > > > VS 2005 w/SP1 / XP Pro w/all service packs > > > > > > > > One of our forms has a Tab-control onto which is dynamically added a > > > > number of other controls. When the added controls are ComboBoxes or > > > > CheckListBoxes, their OnClick event is fired before their OnEnter. For > > > > other controls on the Tab (e.g. ListBox) the events occur in the > > > > expected order -- Enter and then Click. On other forms where the > > > > controls are added to a Tab-control at design-time, the Enter / Click > > > > also occur in the expected order. Does anyone have any idea why on this > > > > form the Click (and MouseClick) event would precede the Enter event? > > > > > > > > -- > > > > // Lee Silver > > > > // Information Concepts Inc. |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

