I have third party control called TopicBar which looks like window xp navigation bar that you can see on the left side of a window
In my application I've 71 forms I have created a DB table to store all my forms Name
and Text
,A partcular user can add which forms(by searching form's name that I have already stored in a table) should add in topicbar as item.
For example, A form called FrmBill and its name is Bill once a user addes Bill to Topicbar it will successfully creates an item with name Bill,Now what I'm facing is I need to open the form FrmBill when that user clicks on Bill item in topicbar
I can get form name ie FrmBill is a user clicks in Bill but I couldnt open the form becuase I need to dynamically create instance or call Form here frmBill
what I have done so far
Dim formName As String
Dim frm As Form
Using conn As New SqlConnection(conn_str)
conn.Open()
Dim cmd As SqlCommand
cmd = New SqlCommand("", conn)
cmd.CommandText = "select top 1 formname from winforms where id=" & winformid & ""
formName = cmd.ExecuteScalar
'output: FrmBill
frm = New Form
frm.Name = formName '(FrmBill)
With frm
.MdiParent = FrmMain
.Show()
.Focus()
End With
End Using
Note: in this function I can get form name ie FrmBill
from the DB, but its not showing the actual form FrmBill
So is there anyways to declare form name like below
dim frm as new "& formname &"
See Question&Answers more detail:os