I know this is silly but I can't figure out how to do this in a tidy fashion.
If the dialog result is OK then I want to get a string from my dialogbox.
Any ideas
TIA
Printable View
I know this is silly but I can't figure out how to do this in a tidy fashion.
If the dialog result is OK then I want to get a string from my dialogbox.
Any ideas
TIA
I would create a public property within the form itself. Then you can access the value through the property.
So (Pseudo code since I don't have VS in front of me)
If (MyDialog.ShowDialog() = DialogResult.OK) Then
MessageBox.Show(MyDialog.TextProperty)
End If
How do you normally get a string from an object? You get a property value or call a method and get the return value. So... how do you get a string from your form, bearing in mind that a form is an object?