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
Re: textbox and mouse_down event
maybe u should use the click event.
Re: textbox and mouse_down event
Quote:
Originally Posted by mebhas
maybe u should use the click event.
can you send me an example?
thanks boris
Re: textbox and mouse_down event
Quote:
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
Re: textbox and mouse_down event
Quote:
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
Re: textbox and mouse_down event
Quote:
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
Re: textbox and mouse_down event
Quote:
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.
Re: textbox and mouse_down event
Re: textbox and mouse_down event
Quote:
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.
Re: textbox and mouse_down event
Quote:
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.
Re: textbox and mouse_down event
Quote:
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