|
-
Jun 22nd, 2006, 05:16 PM
#1
Thread Starter
Addicted Member
Can I disable the left mouse click
Hello.
On my form I have a Frame containing 6 Textbox's and I need to stop the user from clicking on these Textbox's with the Left mouse button but I still need the user to be able to Tab from one box to the next. On the forum I have seen a couple of code posts that claim to disable the mouse click but I cannot get either one to work.
If anyone can help I would be most gratefull.
Thanks.
SKM
-
Jun 22nd, 2006, 05:17 PM
#2
Re: Can I disable the left mouse click
So, you want to prevent a TextBox from gaining the Focus when using the mouse?
-
Jun 22nd, 2006, 05:37 PM
#3
Re: Can I disable the left mouse click
Here is a simple solution using a hidden CommandButton (with it's TabStop diabled):
VB Code:
Option Explicit
Private Sub Form_Load()
cmdHidden.TabStop = False
End Sub
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then cmdHidden.SetFocus
End Sub
If your TextBox's were in a Control Array, then you would just need one line of code, as the example I provided will only do ONE of them .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|