|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
One variable can call many formI want to ask how to call form with only one variable in VB.Net. I have 3 form (Form1, Form2 and Form3) and 1 module. in the module i want to declare public variable to call form for ex: Public frm as ..... In the Form1 i have two button (btnForm2 and btn Form3) and one Function. Public Function callForm(FormName as String) frm=.............. frm.show() frm.txtNameForm.text=FormName End Function In the Form2 i have one textbox (txtNameForm) In the Form3 i have one textbox(txtnameForm) So, if I click btnForm2 it will "Call callForm("Form2"), Form2 will displayed and txtnameForm="Form2". And If I click btnForm3 it will "Call callForm("Form3"), Form3 will displayed and txtnameForm="Form3". So can anybody help me how to declare the frm variable so it can call many form. Thanks b4 try something along these lines
Private frm As Form Private Sub Button1_Click(...) frm = New Form2 frm.Show() End Sub Private Button2_Click(...) frm = New Form3 frm.Show() End Sub hope that helps -- -iwdu15 Thanks, it works in Windows Application. But when i try it in Smart
Device Application, it's error. Is .Net Framework not support that in Smart Device? Thanks iwdu15 wrote: Show quoteHide quote > try something along these lines > > Private frm As Form > > Private Sub Button1_Click(...) > > frm = New Form2 > frm.Show() > > End Sub > > Private Button2_Click(...) > > frm = New Form3 > frm.Show() > > End Sub > > > hope that helps > -- > -iwdu15
Space in textBox
Auto Increment Version in VB 2005 ToolBox Icon corruption VB2005 Transparent backcolor Thread safe TextWriter question SqlDataAdapter Questions How do I copy all text files into one??? eg; Shell("copy c:\CND\dr*.txt C:\CND\TestC.txx") Error adding rows to tables function help please how to control/check Date datatype inputs in textobx? |
|||||||||||||||||||||||