|
-
Dec 9th, 2005, 01:53 AM
#1
Thread Starter
Addicted Member
textbox and mouse_down event
Hi guys,
I would like to make sensible textbox to mouse_down event.
I have created userform1, textbox4. Can anybody help me, why the following code is wrong?
VB Code:
Private Sub Textbox4_MouseDown(ByVal Button As Integer)
If Button = 1 Then UserForm2.Show
End Sub
Thanks.
Boris
-
Dec 9th, 2005, 01:54 AM
#2
Frenzied Member
Re: textbox and mouse_down event
maybe u should use the click event.
-
Dec 9th, 2005, 02:19 AM
#3
Thread Starter
Addicted Member
Re: textbox and mouse_down event
 Originally Posted by mebhas
maybe u should use the click event.
can you send me an example?
thanks boris
-
Dec 9th, 2005, 02:21 AM
#4
Re: textbox and mouse_down event
 Originally Posted by bolcskei
Hi guys,
I would like to make sensible textbox to mouse_down event.
I have created userform1, textbox4. Can anybody help me, why the following code is wrong?
VB Code:
Private Sub Textbox4_MouseDown(ByVal Button As Integer)
If Button = 1 Then UserForm2.Show
End Sub
Thanks.
Boris
This code works fine for me:
VB Code:
Private Sub Text1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then Form2.Show
End Sub
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Dec 9th, 2005, 02:43 AM
#5
Thread Starter
Addicted Member
Re: textbox and mouse_down event
 Originally Posted by Mark Gambo
This code works fine for me:
VB Code:
Private Sub Text1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then Form2.Show
End Sub
it writes me "Procedure declaration does not match description of event or procedure having the same name" error.
Boris
-
Dec 9th, 2005, 02:49 AM
#6
Frenzied Member
Re: textbox and mouse_down event
it writes me "Procedure declaration does not match description of event or procedure having the same name" error.
u should change the text1_mouseup to textbox4_mouseup
and as for the click event,
VB Code:
Private Sub TextBox4_Click()
Form2.Show
End Sub
-
Dec 9th, 2005, 03:04 AM
#7
Thread Starter
Addicted Member
Re: textbox and mouse_down event
 Originally Posted by mebhas
u should change the text1_mouseup to textbox4_mouseup
and as for the click event,
VB Code:
Private Sub TextBox4_Click()
Form2.Show
End Sub
That time I have changed it to
VB Code:
Private Sub Textbox4_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then UserForm2.Show
End Sub
But it did not worked. I was also trying
VB Code:
Private Sub TextBox4_click()
UserForm2.Show (vbModeless)
End Sub
At the moment works me:
VB Code:
Private Sub textbox4_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
If Cancel.Value = False Then UserForm2.Show
End Sub
May be I have version of VB where the click event do not work, but I do not understand the problem with mouse_down, because in help I have found it.
-
Dec 9th, 2005, 07:25 AM
#8
Re: textbox and mouse_down event
-
Dec 9th, 2005, 07:29 AM
#9
Thread Starter
Addicted Member
Re: textbox and mouse_down event
 Originally Posted by Hack
Are you using VB or VBA?
I have Visual Basic Editor as a part of office and thefore I think I have VBA.
-
Dec 9th, 2005, 07:34 AM
#10
Re: textbox and mouse_down event
 Originally Posted by bolcskei
I have Visual Basic Editor as a part of office and thefore I think I have VBA.
And that is why some of the proposed solutions that have been posted aren't working for you. VBA is a subset of VB, and many of the features of VB are not supported in VBA.
You will receive VBA specific help from the Office Development folks.
Moved.
-
Dec 9th, 2005, 08:03 AM
#11
Thread Starter
Addicted Member
Re: textbox and mouse_down event
 Originally Posted by Hack
And that is why some of the proposed solutions that have been posted aren't working for you. VBA is a subset of VB, and many of the features of VB are not supported in VBA.
You will receive VBA specific help from the Office Development folks.
Moved.
Thank you
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
|