Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing from Form to Sub Main
Message
De
17/03/2004 11:40:28
 
 
À
17/03/2004 10:16:07
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00887072
Message ID:
00887114
Vues:
14
I'm going to make a few assumptions here. First assumption, that your frmStartup is a modal dialog. If so, you can grab properties from the form from your Sub Main. Something like this (please remember that I'm using a C#-to-VB converter so the syntax may be off a bit):
If frmStartup.ShowDialog() = DialogResult.OK Then
   Me.MyVariable = frmStartup.FormVariable
End If
and then pass it to your frmMain like this:
Dim oMainForm As New frmMain(Me.MyVariable)
oMainForm.Show()
of course, frmMain would need to declare parameters in it's constructor, like this:
Public Class frmMain
   Inherits System.Windows.Form
   
   ' Form's constructor
   Public Sub New(MyParm As String)
      ' code here to handle parm
      InitializeComponent()
   End Sub 'New
End Class 'frmMain
Anyway, that should be enough to get you started ...

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform