Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2007

Tip: Looking for answers? Try searching our database.

OnClick preceding OnEnter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lee - 09 Jan 2007 20:03 GMT
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.
Lee - 11 Jan 2007 11:30 GMT
Anyone have any thoughts on why OnClick would precede OnEnter?

> VS 2005 w/SP1 / XP Pro w/all service packs
>
[quoted text clipped - 10 lines]
> // Lee Silver
> // Information Concepts Inc.
Bryan Phillips - 15 Jan 2007 03:59 GMT
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

> Anyone have any thoughts on why OnClick would precede OnEnter?
>
[quoted text clipped - 12 lines]
> > // Lee Silver
> > // Information Concepts Inc.
Lee - 15 Jan 2007 11:47 GMT
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.
[quoted text clipped - 20 lines]
> > > // Lee Silver
> > > // Information Concepts Inc.
Lee - 16 Jan 2007 17:53 GMT
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.

> Bryan:
>
[quoted text clipped - 39 lines]
> > > > // Lee Silver
> > > > // Information Concepts Inc.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.