Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Execution of string variable containing form name
Message
General information
Forum:
ASP.NET
Category:
Forms
Title:
Execution of string variable containing form name
Miscellaneous
Thread ID:
00790231
Message ID:
00790231
Views:
59
This should be the easiest thing to do. In a SQL Server table, I store menu information that is later shown in a tree-view control on a winform. The menu shows the names of forms that can be invoked. One of the columns contains the names of the various forms that can be executed (shown).

These would be sample rows from the menu table:
Menu Caption            Form Name
-------------------     -------------
Accounts Receivable     frmAR
Accounts Payable        frmAP
Order Entry             frmOrderEntry
All of the forms have been defined in the solution.
When the user clicks on the tree-view node, I want the application to invoke the appropriate form, but I want to execute the form as a macro substitution. In Visual FoxPro (God how I miss it!) I could do the following:
command = "do form " + cFormName
&command
where cFormName is the name of the form that was brought in as data in the table row (ex: frmOrderEntry) and lo and behold the form would execute (if it could be found in the project path). Please spare me the verbage as to why this is a security issue and the history of compiled versus runtime languages. Can VB.NET do this...if so...how. Specific (and simple) code examples would be immensely appreciated. I'm at wit's end if that's not obvious from my demeanor.

I cannot find how to do this in vb.net winforms (even the latest Visual Studio .Net 2003 version). Any help would be greatly appreciated.
He who knows not and knows not he knows not, he is a fool, shun him.
He who knows not but knows he knows not, he is simple, teach him.
He who knows, but knows not he knows, he is asleep, wake him.
He who knows and knows he knows, He is wise, follow him.
Next
Reply
Map
View

Click here to load this message in the networking platform