I have a textbox
and when I scroll down my form with the mouse wheel and hit the textbox with the mouse, it stops scrolling.
Is there a way to avoid that ?
I have a textbox
and when I scroll down my form with the mouse wheel and hit the textbox with the mouse, it stops scrolling.
Is there a way to avoid that ?
If you don't want a TextBox
to be focused, you have a few solutions
ReadOnly
property to TrueNobody will be able to enter text in your TextBox
, exept if you do it programatically. However, it will still be possible to click on it and if clicked you will see the blinking cursor (don't know the name in English). When the mover hovers it it will turn into a cursor.
This means this option allows the focus on the control, but it will not be possible to enter data.
Enabled
property to FalseAgain, it will not be possible to enter any data. Also, it will not be possible to click on it and the cursor will not change if you hover it.
This means this option disallows the focus on the control.
Label
insteadIf nobody will ever be able to insert data in your TextBox
, maybe it is better to put a Label
there. If you choose option 1 or 2, it is because at some point you might allow user to change the text inside. But if it will only be modified by the program, Label
is good enough.
Focus is never allowed on Labels.
OK, If I understand you correctly, what you are searching is to keep mouse wheeling while passing on your TextBox. Is that correct ?
There is, I think, a way to achieve that. This code however has not been tested, so keep me informed if it worked.
Public Sub New()
InitializeComponents()
'Other inits here
AddHandler TextBox1.MouseWheel, AddressOf TBMouseWheel
End Sub
Private Sub TBMouseWheel(sender As Object, e As MouseEventArgs)
Me.OnMouseWheel(e)
End Sub
This way, when your textbox captures a MouseWheel event, it is passed on the form, which will handle it (I think). Sorry I don't have the opportunity to test it right now, but I believe this should do the trick.