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 / July 2007

Tip: Looking for answers? Try searching our database.

Mouse roller changes combobox SelectedItem not visible, wich fires SelectedIndexChanged event

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
João Araújo - 17 Jul 2007 12:26 GMT
Hi,

My form has several group, combo and textboxs. To make it easier to
reproduce I've simplified:
1) one group box with a combobox and a textbox and the combo has the focus;
2) the user first selects and item from combobox and the focus passes to
textbox;
3) user doubleclicks on textbox and the current groupbox which fires this:
   a) current groupbox visible status changes to false;
   b) based on the information the user selected on the combobox, a
DatagridView is displayed in another groupbox, changing focus to it;
   c) and now, this is the problem, if the user uses the mouse roller then
combobox, in the invisible groupbox, SelectedItem is changed and I can't
explain why.

If the first groupbox stills visible, the problem does not occurs, but that
is not an aceptable solution, because the form remains with too much
information.

I hope my problem has become clear.

Thanks.
João.
Jared - 22 Jul 2007 04:55 GMT
If you are looking at intercepting MouseRoll and nulling it out, here is
some code I was typing today...

Public Class SpecialComboBox
Inherits ComboBox

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)

Const WM_COMMAND As Int32 = 273

Select Case True
Case m.Msg = WM_COMMAND And m.WParam = New System.IntPtr(66536) 'intercepts
WM_COMMAND (which prevent DropDownBox from closing after WM_LBUTTONDOWN)

 '2 - (NEW) nulls MouseWheel on not .DropDown
  If Not Me.DroppedDown Then
  Exit Sub
  End If

End Select

MyBase.WndProc(m)

End Sub

End class

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.