Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get Control handle from Name

Status
Not open for further replies.

nomi2000

ISP
Feb 15, 2001
676
CA
Hi guys
I have a Grid in one of a web-page in which in the first column (which is hidden) i have the name of the control like
Dim sSelectedControl As String = GridSystemRules.DisplayLayout.SelectedRows.Item(0).GetCellValue(GridSystemRules.Columns.Item(0))

Now what i want is can i have the handle or refrence of that control from the string above so i can use that object ,the control could be textbox,listbox or any other control
In VB .Net i can instatiate any form by using this code which takes the form name and instiate the new form but here i don't know how to get handle from the string
Try

Dim tempAssembly As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()

Dim frm1 As Form = CType(tempAssembly.CreateInstance(textBox1.Text), Form) ' as Form;

frm1.Show()

Catch ex As Exception

MessageBox.Show("Error creating: " + ex.ToString())

End Try

Regards
Nouman

Nouman Zaheer
Software Engineer
MSR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top