|
-
Jul 28th, 2007, 01:16 AM
#1
Thread Starter
Hyperactive Member
how do i go about this?
hi,
im trying to create a global procedure in my class module that calls a form
i have these codes on every form but the form im calling differs... this is just an example.
Code:
'Code I have in my Form1 in a button to call Form2.
Dim myForm2 as New Form2
myForm2.MdiParent = Me.MdiParent
myForm2.Show
i tried creating a module and placed these codes
Code:
Public Sub Load_Form(ByVal FormToLoad As Form)
Dim Active_Form As New FormToLoad
Active_Form.MdiParent = Me.MdiParent
Active_Form.Show
End Sub
unfortunately, there are some errors on this. those underlined causes some problems... are there any other approach on how to do this?
VB Version: Microsoft Visual Studio 2008 Professional Edition
.NET Version: Microsoft .NET Framework Version 3.5
OS: Windows XP SP3
-
Jul 28th, 2007, 02:10 AM
#2
Lively Member
Re: how do i go about this?
Hi
u can use technique of late binding like below
vb Code:
Public Sub loadForm(ByVal frm As Form)
Dim f As New Form
f = frm
f.MdiParent = MDIParent1
f.Show()
End Sub
-
Jul 28th, 2007, 04:59 AM
#3
Thread Starter
Hyperactive Member
Re: how do i go about this?
VB Version: Microsoft Visual Studio 2008 Professional Edition
.NET Version: Microsoft .NET Framework Version 3.5
OS: Windows XP SP3
-
Jul 28th, 2007, 08:33 AM
#4
Re: how do i go about this?
It's not gonna work if you want to load a specific form... It only load a generic blank form for you with that code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|