Click here to Skip to main content
15,918,007 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Select from a DataTable in VB.NET Pin
nlindley730-Jul-07 9:25
nlindley730-Jul-07 9:25 
GeneralRe: Select from a DataTable in VB.NET Pin
txmrm30-Jul-07 9:58
txmrm30-Jul-07 9:58 
GeneralRe: Select from a DataTable in VB.NET Pin
MohammadAmiry30-Jul-07 10:21
MohammadAmiry30-Jul-07 10:21 
GeneralRe: Select from a DataTable in VB.NET Pin
MohammadAmiry31-Jul-07 2:48
MohammadAmiry31-Jul-07 2:48 
QuestionCancel mouse wheel scrolling in a combobox VB.NET Pin
Marcus J. Smith30-Jul-07 7:38
professionalMarcus J. Smith30-Jul-07 7:38 
AnswerRe: Cancel mouse wheel scrolling in a combobox VB.NET Pin
Dave Kreskowiak30-Jul-07 8:42
mveDave Kreskowiak30-Jul-07 8:42 
GeneralRe: Cancel mouse wheel scrolling in a combobox VB.NET Pin
Marcus J. Smith31-Jul-07 2:59
professionalMarcus J. Smith31-Jul-07 2:59 
GeneralRe: Cancel mouse wheel scrolling in a combobox VB.NET Pin
Dave Kreskowiak31-Jul-07 4:16
mveDave Kreskowiak31-Jul-07 4:16 
Where is this code?? Is it on your Form or is it part of a custom ComboBox control?? This code has to be part of a custom ComboBox to work.

You got it mostly right. Though, your Select Case is really messed up. You don't need the Select Case True. That will ALWAYS execute it's code no matter what. All you want is to NOT process MouseWheel messages. All other MUST be passed to the base ComboBox control. Soooo....
Public Class MyComboBox
    Inherits ComboBox
 
    Private Const WM_MOUSEWHEEL As Integer = &H20A
 
    Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
        Select Case m.Msg
            Case WM_MOUSEWHEEL
                ' If we see a MouseWheel message, do not process it!
                Exit Sub
        End Select
 
        ' All other messages get processed as normal.
        MyBase.WndProc(m)
    End Sub
End Class

... is what you're looking for.



A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: Cancel mouse wheel scrolling in a combobox VB.NET Pin
Marcus J. Smith31-Jul-07 4:20
professionalMarcus J. Smith31-Jul-07 4:20 
Questionprint bar code - code 39 Pin
frobozzdamad30-Jul-07 7:20
frobozzdamad30-Jul-07 7:20 
AnswerRe: print bar code - code 39 Pin
Joseph Guadagno30-Jul-07 8:22
Joseph Guadagno30-Jul-07 8:22 
QuestionAccessing a variable on another form Pin
'Drew30-Jul-07 7:05
'Drew30-Jul-07 7:05 
AnswerRe: Accessing a variable on another form Pin
penguin500030-Jul-07 10:21
penguin500030-Jul-07 10:21 
GeneralRe: Accessing a variable on another form Pin
'Drew30-Jul-07 11:02
'Drew30-Jul-07 11:02 
GeneralRe: Accessing a variable on another form Pin
'Drew30-Jul-07 13:14
'Drew30-Jul-07 13:14 
GeneralRe: Accessing a variable on another form Pin
Paul Conrad30-Jul-07 11:13
professionalPaul Conrad30-Jul-07 11:13 
AnswerRe: Accessing a variable on another form Pin
Christian Graus30-Jul-07 11:02
protectorChristian Graus30-Jul-07 11:02 
QuestionProblem while running a vb.net application in Network Pin
vut230-Jul-07 7:01
vut230-Jul-07 7:01 
AnswerRe: Problem while running a vb.net application in Network Pin
Dave Kreskowiak30-Jul-07 8:49
mveDave Kreskowiak30-Jul-07 8:49 
Questionplz help about the ruler Pin
eyes200730-Jul-07 5:40
eyes200730-Jul-07 5:40 
Questionkeydown event doesn't get triggerd Pin
Tom Deketelaere30-Jul-07 5:03
professionalTom Deketelaere30-Jul-07 5:03 
QuestionListView and ContextMenu Pin
Sebastian T Xavier30-Jul-07 4:27
Sebastian T Xavier30-Jul-07 4:27 
QuestionWebservice written in VB.NET Pin
microdommi30-Jul-07 4:04
microdommi30-Jul-07 4:04 
AnswerRe: Webservice written in VB.NET Pin
kubben30-Jul-07 6:43
kubben30-Jul-07 6:43 
GeneralRe: Webservice written in VB.NET Pin
microdommi30-Jul-07 10:19
microdommi30-Jul-07 10:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.