By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,417 Members | 1,178 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,417 IT Pros & Developers. It's quick & easy.

DoClick

P: n/a
What is comparable to the DoClick command in VBNet?

Thanks...Arne
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi,
I assume it simulates a mouse-click event? If so: To do the same in VB.NET,
you may just call the click event procedure like other method calls. Just
pass Nothing to both the parameters of the event procedure.

HTH.

"Arne Beruldsen" <Ar***********@discussions.microsoft.com> wrote in message
news:46**********************************@microsof t.com...
What is comparable to the DoClick command in VBNet?

Thanks...Arne
Nov 20 '05 #2

P: n/a
Hi,

Button1.PerformClick()

Ken

--------------------------

"Arne Beruldsen" <Ar***********@discussions.microsoft.com> wrote in message
news:46**********************************@microsof t.com...
What is comparable to the DoClick command in VBNet?

Thanks...Arne
Nov 20 '05 #3

P: n/a
Hi Arne,

Although you have an answer from Ken and Shiva I made a sample today.

I hope it helps as well as the both other answers?

Cor

\\\needs 2 buttons and a textbox on a form nothing more
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Button2.PerformClick()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button2.Click
Dim mypress As New KeyPressEventArgs("D"c)
TextBox1_KeyPress(sender, mypress)
End Sub
Private Sub TextBox1_KeyPress(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles _
TextBox1.KeyPress
MessageBox.Show("I am clicked by key " & _
e.KeyChar & " in " & _
DirectCast(sender, Control).Name)
End Sub
///
Nov 20 '05 #4

P: n/a
"Shiva" <sh******@online.excite.com> wrote in message
news:O3**************@TK2MSFTNGP09.phx.gbl...
Hi,
I assume it simulates a mouse-click event? If so: To do the same in VB.NET, you may just call the click event procedure like other method calls. Just
pass Nothing to both the parameters of the event procedure.


Fantastic. I was looking for something like this the other day. I ended up
using PerformClick. It never dawned on me that they're just subroutines and
I could just call them. Duh.
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.