Invoke Treeview Click Event

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
 
R

Robbe Morris [C# MVP]

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
 
G

Guest

Robbe,
All I need is to know how to trigger the Treeview's Click event; it is
needed for my very specific design.
 

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

Top