|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
String Name to a User Control?If I have a string field that contains the name of a User Control, how could
I access the User Control? I need something like the following function: dim ucUC as UserControl Dim strUC as string strUC = "MyUserControl" ucUC = ToUserControl(strUC) 'Which would be the same as ucUC = MyuserControl Thanks for your help. Dave WHy not build your function referencing the type of control it is? Instead
of trying to pass it as a string. Sub TESTME(ByVal thiscontrol as UserControl) -- Show quoteHide quoteGet a powerful web, database, application, and email hosting with KJM Solutions http://www.kjmsolutions.com "Dave" <D***@discussions.microsoft.com> wrote in message news:E411A9A1-F19D-45F9-B33C-0721243F5391@microsoft.com... > If I have a string field that contains the name of a User Control, how > could > I access the User Control? I need something like the following function: > > dim ucUC as UserControl > Dim strUC as string > > strUC = "MyUserControl" > ucUC = ToUserControl(strUC) 'Which would be the same as ucUC = > MyuserControl > > Thanks for your help. > Dave > I've got a menu displayed for the user. They select what screen they want to
see. I've got the name of the User Control stored in the TAG property for each entry in the menu. They click the menu item, I've got the string name, now I need to bring up the User Control. Hence the need for the function..... Dave Show quoteHide quote "vbnetdev" wrote: > WHy not build your function referencing the type of control it is? Instead > of trying to pass it as a string. > > Sub TESTME(ByVal thiscontrol as UserControl) > > -- > Get a powerful web, database, application, and email hosting with KJM > Solutions > http://www.kjmsolutions.com > > > > "Dave" <D***@discussions.microsoft.com> wrote in message > news:E411A9A1-F19D-45F9-B33C-0721243F5391@microsoft.com... > > If I have a string field that contains the name of a User Control, how > > could > > I access the User Control? I need something like the following function: > > > > dim ucUC as UserControl > > Dim strUC as string > > > > strUC = "MyUserControl" > > ucUC = ToUserControl(strUC) 'Which would be the same as ucUC = > > MyuserControl > > > > Thanks for your help. > > Dave > > > > > OpenMeCauseItWasChosen(UserControl)
Function OpenMeCauseItWasChosen(ByVal thiscontrol As UserControl) As Boolean If thisform.Tag = "OPENTHISONE" Then thisform.Show() End If Return True End Function -- Show quoteHide quoteGet a powerful web, database, application, and email hosting with KJM Solutions http://www.kjmsolutions.com "Dave" <D***@discussions.microsoft.com> wrote in message news:A98BDC28-687C-42B3-BE34-20D409555856@microsoft.com... > I've got a menu displayed for the user. They select what screen they want > to > see. I've got the name of the User Control stored in the TAG property for > each entry in the menu. They click the menu item, I've got the string > name, > now I need to bring up the User Control. Hence the need for the > function..... > > Dave > > > "vbnetdev" wrote: > >> WHy not build your function referencing the type of control it is? >> Instead >> of trying to pass it as a string. >> >> Sub TESTME(ByVal thiscontrol as UserControl) >> >> -- >> Get a powerful web, database, application, and email hosting with KJM >> Solutions >> http://www.kjmsolutions.com >> >> >> >> "Dave" <D***@discussions.microsoft.com> wrote in message >> news:E411A9A1-F19D-45F9-B33C-0721243F5391@microsoft.com... >> > If I have a string field that contains the name of a User Control, how >> > could >> > I access the User Control? I need something like the following >> > function: >> > >> > dim ucUC as UserControl >> > Dim strUC as string >> > >> > strUC = "MyUserControl" >> > ucUC = ToUserControl(strUC) 'Which would be the same as ucUC = >> > MyuserControl >> > >> > Thanks for your help. >> > Dave >> > >> >> >> sorry it should be thiscontrol not thisform.
-- Show quoteHide quoteGet a powerful web, database, application, and email hosting with KJM Solutions http://www.kjmsolutions.com "vbnetdev" <vbnetdev@community.nospam> wrote in message news:%23iRT7mceGHA.3792@TK2MSFTNGP03.phx.gbl... > OpenMeCauseItWasChosen(UserControl) > > Function OpenMeCauseItWasChosen(ByVal thiscontrol As UserControl) As > Boolean > If thisform.Tag = "OPENTHISONE" Then > thisform.Show() > End If > Return True > End Function > -- > Get a powerful web, database, application, and email hosting with KJM > Solutions > http://www.kjmsolutions.com > > > > "Dave" <D***@discussions.microsoft.com> wrote in message > news:A98BDC28-687C-42B3-BE34-20D409555856@microsoft.com... >> I've got a menu displayed for the user. They select what screen they want >> to >> see. I've got the name of the User Control stored in the TAG property for >> each entry in the menu. They click the menu item, I've got the string >> name, >> now I need to bring up the User Control. Hence the need for the >> function..... >> >> Dave >> >> >> "vbnetdev" wrote: >> >>> WHy not build your function referencing the type of control it is? >>> Instead >>> of trying to pass it as a string. >>> >>> Sub TESTME(ByVal thiscontrol as UserControl) >>> >>> -- >>> Get a powerful web, database, application, and email hosting with KJM >>> Solutions >>> http://www.kjmsolutions.com >>> >>> >>> >>> "Dave" <D***@discussions.microsoft.com> wrote in message >>> news:E411A9A1-F19D-45F9-B33C-0721243F5391@microsoft.com... >>> > If I have a string field that contains the name of a User Control, how >>> > could >>> > I access the User Control? I need something like the following >>> > function: >>> > >>> > dim ucUC as UserControl >>> > Dim strUC as string >>> > >>> > strUC = "MyUserControl" >>> > ucUC = ToUserControl(strUC) 'Which would be the same as ucUC = >>> > MyuserControl >>> > >>> > Thanks for your help. >>> > Dave >>> > >>> >>> >>> > >
Byte to Chr - not correctly translated!!
GetDefaultPrinter Saving a JPG from the web to local disk VB.NET Windows Service Question (Timing) How Do I Put An End Of Line Character In A TextBox User Software Settings and System Software Settings in Windows Regsitry Dynamically Create Timers are Run-Time VB Express - How to access query value on my form? Confusion over namespaces CSV file reading every other record... |
|||||||||||||||||||||||