Form load @ runtime

  • Thread starter Thread starter Christian Hamel
  • Start date Start date
C

Christian Hamel

Hello.
Here's my problem. I have a Treeview with many options and in the TAG
property of these nodes, I have a form name (frmDetail, frmheader, etc..).
In the doubleclick event of my Treeview, I would like to open the proper
form based on the value in the TAG property. This must be easy but I can't
find the way :(
Any help would be appreciated.
Thanks.
 
Forget it. Found the answer in Groups.Google.Com

myGenericForm = New Form

myGenericForm =
CType(GetExecutingAssembly.CreateInstance("WhatANiceProjectName." &
sFormNameToLoadAsString, True), Form)

myGenericForm.Show()
 
I must be missing something..what's wrong with:

dim frm as Form
if treenode.tag = "whatever" then
frm = new frmDetail
frm.Show or frm.ShowDialog
end if
 

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

Back
Top