PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms OnClick preceding OnEnter

Reply

OnClick preceding OnEnter

 
Thread Tools Rate Thread
Old 09-01-2007, 08:03 PM   #1
Lee
Guest
 
Posts: n/a
Default OnClick preceding OnEnter


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.

  Reply With Quote
Old 11-01-2007, 11:30 AM   #2
Lee
Guest
 
Posts: n/a
Default Re: OnClick preceding OnEnter

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.


  Reply With Quote
Old 15-01-2007, 03:59 AM   #3
Bryan Phillips
Guest
 
Posts: n/a
Default Re: OnClick preceding OnEnter

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.


  Reply With Quote
Old 15-01-2007, 11:47 AM   #4
Lee
Guest
 
Posts: n/a
Default Re: OnClick preceding OnEnter


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.


  Reply With Quote
Old 16-01-2007, 05:53 PM   #5
Lee
Guest
 
Posts: n/a
Default Re: OnClick preceding OnEnter

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.


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off