DoClick

  • Thread starter Thread starter Guest
  • Start date Start date
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.

What is comparable to the DoClick command in VBNet?

Thanks...Arne
 
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
///
 
Shiva said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top