Invoke Treeview Click Event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In the following VB.Net code; how do I invoke the TV_Click event in Button2's
Click event. Thans

Private Sub TV_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles TV.Click
MsgBox(TV.SelectedNode.Text)
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
TV.SelectedNode = TV.Nodes(1)
TV.Focus()
''' INVOKE the TV_Click EVENT HERE so the msgbox will be displayed
End Sub
 
Proper design would have you create a method that is triggered
in the click event and also called from anywhere versus
having a bunch of invoke code all over the place.

--
Robbe Morris - 2004-2006 Microsoft MVP C#
I've mapped the database to .NET class properties and methods to
implement an multi-layered object oriented environment for your
data access layer. Thus, you should rarely ever have to type the words
SqlCommand, SqlDataAdapter, or SqlConnection again.
http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp
 
Robbe,
All I need is to know how to trigger the Treeview's Click event; it is
needed for my very specific design.
 
Back
Top