jes12345
asked on
Returning string from multiline textbox to calling form VB.NET
I have a main form that opens a new form with a multiline textbox. When I doubleclick one of the lines in the multiline textbox I want the line to be returned to the main form. How can I do this?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I would also recommend setting DialogResult() in Form2 to "OK" or "Cancel" from Buttons so you can check that back in Form1:
Dim f2 As New Form2
If f2.ShowDialog() = DialogResult.OK Then
Else
End If
This gives you the option to trap whether the "dialog" was accepted or cancelled by the user.
In Form2:
Private Sub btnClick_Click(...) Handles btnClick.Click
Me.DialogResult = DialogResult.OK
End Sub
Private Sub btnCancel_Click(...) Handles btnCancel.Click
Me.DialogResult = DialogResult.Cancel
End Sub
Dim f2 As New Form2
If f2.ShowDialog() = DialogResult.OK Then
Else
End If
This gives you the option to trap whether the "dialog" was accepted or cancelled by the user.
In Form2:
Private Sub btnClick_Click(...) Handles btnClick.Click
Me.DialogResult = DialogResult.OK
End Sub
Private Sub btnCancel_Click(...) Handles btnCancel.Click
Me.DialogResult = DialogResult.Cancel
End Sub
ASKER