|
-
Jul 16th, 2003, 05:45 AM
#1
Thread Starter
Hyperactive Member
Loading Forms *RESOLVED*
When loading forms at the moment I am using the following -
VB Code:
Sub LoadReportsForm()
Dim NewMDIChild As New frmReportViewer()
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Show()
End Sub
But I could end up with around 15 forms in my solution and I don't really think I want to use this code for each form.
Is there a way that I can make this into one sub that will load any form by just specifying the form I would like to load???
Regards,
Matt.
Last edited by MattJH; Jul 16th, 2003 at 06:26 AM.
-
Jul 16th, 2003, 06:14 AM
#2
you could do this :
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
LoadReportsForm("frm", New Form2())
End Sub
Private Sub LoadReportsForm(ByVal strname As Object, ByVal strform As Object)
strname = strform
strname.MdiParent = Me
strname.Show()
End Sub
hope it helps.
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Jul 16th, 2003, 06:23 AM
#3
Thread Starter
Hyperactive Member
Brilliant, Thank you very much!!!!!!
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
|