A form that returns a value

  • Thread starter Thread starter Dustin Davis
  • Start date Start date
D

Dustin Davis

I'm creating a wizard and I've got multiple paths a user can go through
and multiple forms depending on the options they choose on each form.

Is it possible to have a form return a value, much like a function?

For example:

Dim Step1 As New frmStep1
FileType = Step1.ShowDialog

.... or even passing values by reference:

Dim Step1 As New frmStep1(FileType, FileName)
Step1.ShowDialog()
 
Dustin said:
I'm creating a wizard and I've got multiple paths a user can go through
and multiple forms depending on the options they choose on each form.

Is it possible to have a form return a value, much like a function?

For example:

Dim Step1 As New frmStep1
FileType = Step1.ShowDialog

... or even passing values by reference:

Dim Step1 As New frmStep1(FileType, FileName)
Step1.ShowDialog()

Just add them as properties to the form. Then you can reference them
like this:

Dim Step1 As New frmStep1
Step1.ShowDialog
FileType = Step1.FileType
FileName = Step1.FileName

HTH
 
Tom said:
Just add them as properties to the form. Then you can reference them
like this:

Dim Step1 As New frmStep1
Step1.ShowDialog
FileType = Step1.FileType
FileName = Step1.FileName

HTH

Oh, wow, so simple :blush: - Thanks!

Dustin
 
Back
Top