-
This is what i need to do. A number is stored in a text box. If i left click the number decreases by one, and if i right click then the number increases by one.
The problem is that when i right click a drop down menu appears!!!!
How can I get rid of this drop down menu or is there an alternative method of what I am tring to do.
Many Thanks
Nick
-
If you don't need to be able to type in it, you could use
a Label instead. Change the backcolor and borderstyle
to make it look exactly like a text box.
-
Use an UpDown control with the textbox:
Add a Textbox and an UpDown control to a form and paste the following into the Form_Load event:
Code:
Private Sub Form_Load()
Text1.Text = 0
With UpDown1
.BuddyControl = Text1
.BuddyProperty = "Text"
.Alignment = cc2AlignmentRight
.Min = 0
.Max = 50
End With
End Sub
This allows the right click menu to be retained, as users will expect!
:cool:
-
To disable right click in a textbox, take a look at this thread.