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

User Controls

P: n/a
Hi I have created a usercontrol that has a menu system that I have created,
the menu has an on click event but what I need to do is when this is placed
on the application, when clicked it needs to run a sub procedure that is in
the application that starts another control that opens in a panel.

What I think I need to do is handle the controls events in the application,
but I dont know. This is the first time I have had a need to use these user
controls so have very limited knowledge so any help would be very much
appreciated.


Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

I just had to deal with the same kind of issue with a treeview control and
panels Maybe you can take some of this code and put it to use:

Private Sub ConfigList_AfterSelect(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.TreeViewEventArgs) Handles ConfigList.AfterSelect
Dim myControl as UserControl

Panel1.Controls.Clear()

Select Case e.Node.Tag
Case "1"
myControl = New UserControl1
Case "2"
myControl = New UserControl2
Case "3"
myControl = New UserControl3
End Select

myControl.Parent = Panel1
myControl.Show()

End Sub

"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi I have created a usercontrol that has a menu system that I have created, the menu has an on click event but what I need to do is when this is placed on the application, when clicked it needs to run a sub procedure that is in the application that starts another control that opens in a panel.

What I think I need to do is handle the controls events in the application, but I dont know. This is the first time I have had a need to use these user controls so have very limited knowledge so any help would be very much
appreciated.

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.