|
-
Nov 12th, 2015, 06:38 PM
#16
Thread Starter
Junior Member
Re: Easy Add/Edit/Delete form linked to database tables
Also, how do I use one function to change the user control that is displayed in my frmMain.pnlMain?
I was using:
Dim tempobject as new [usercontrol]
pnlMain.Controls.Clear()
pnlMain.Controls.Add(tempobject)
I had this on each button in the navigation panel and it would change user controls in pnlMain as called. I also want to call changes to the main panel from a user control that is already in the main panel (like drilling down to lookup tables). Instead of referencing the main form. main panel, could I just call my one function that would perform the above code, but the usercontrol would be passed in via parameter?
Something like this:
Public Sub GetUserControl(uc as System.Windows.Forms.Control)
Dim tempobject as new uc
pnlMain.Controls.Clear()
pnlMain.Controls.Add(tempobject)
That code isnt working, Getting error "value of type 'uc' cannot be converted to 'System.Windows.Forms.Control'
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|