|
-
Feb 27th, 2007, 03:32 PM
#1
Thread Starter
Lively Member
[RESOLVED] Right Click Disabled
How can i Disable the Right click in my program?
Last edited by VBN00b001; Feb 27th, 2007 at 06:35 PM.
-
Feb 27th, 2007, 03:41 PM
#2
Re: Right Click
On what specific control?
-
Feb 27th, 2007, 03:47 PM
#3
Thread Starter
Lively Member
-
Feb 27th, 2007, 03:52 PM
#4
Hyperactive Member
Re: Right Click
 Originally Posted by VBN00b001
What you mean?
Right-click will only pop-up a menu in specific controls or if you call it on the form_click event.
If you are trying to disable a right-click on a textbox or richtextbox, we need to know to show you how to disable it.
-
Feb 27th, 2007, 03:52 PM
#5
Re: Right Click
If i understand you correctly, you want to disable right click - as you said, right? So, standard controls don't "react" on right click if not specified - with code (MouseUp, MouseDown... events). If you have some code for those, simply remove/comment it.
-
Feb 27th, 2007, 03:55 PM
#6
Thread Starter
Lively Member
Re: Right Click
Well I guess Its for a text Box Which displays the output
-
Feb 27th, 2007, 04:17 PM
#7
Hyperactive Member
Re: Right Click
Here is how to do it for a textbox
vb Code:
Option Explicit
Dim bIsRightClk As Boolean
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
bIsRightClk = True
End If
End Sub
Private Sub Form_Load()
bIsRightClk = False
End Sub
Private Sub Text1_GotFocus()
If bIsRightClk = True Then
Text1.Enabled = False
Me.SetFocus
Text1.Enabled = True
End If
End Sub
-
Feb 27th, 2007, 06:20 PM
#8
Thread Starter
Lively Member
Re: Right Click
Wow thanks a lot, just one more question what does enabled do
And what does the 2 value do
-
Feb 27th, 2007, 06:31 PM
#9
Hyperactive Member
Re: Right Click
 Originally Posted by VBN00b001
Wow thanks a lot, just one more question what does enabled do
And what does the 2 value do
.Enabled means can you click it or not. It basically "locks" it so you can't do anything with it if set to False.
Button=2 means the 2nd button, or right-mouse button
-
Feb 27th, 2007, 06:34 PM
#10
Thread Starter
Lively Member
-
Feb 28th, 2007, 07:28 AM
#11
Re: [RESOLVED] Right Click Disabled
Just a tip... rather use built-in constant/s instead of a number/s:
Code:
If Button = vbRightButton Then
Type vb in your code editor and press CTRL+SPACE and you'll get a complete list of theme
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
|