Form3 is my dialog box called from a command button in form1.
Form 3 Code:Command Button Code from form1Code:Public Class Form3 Inherits System.Windows.Forms.Form Public ReadOnly Property MySpeed() As String Get Return Me.cmbSpeed.SelectedText.ToString End Get End Property Private Sub okSpdBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles okSpdBtn.Click Me.DialogResult = Windows.Forms.DialogResult.OK End Sub Private Sub cnclSpdBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cnclSpdBtn.Click Me.DialogResult = Windows.Forms.DialogResult.Cancel End Sub End Class
Code:Private Sub btnSpeed_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSpeed.Click If frm2 Is Nothing Then MsgBox("Please start display before changing settings.") Else frm3 = New Form3() frm3.ShowDialog() If frm3.ShowDialog() = Windows.Forms.DialogResult.OK Then Debug.WriteLine("Speed: " & frm3.MySpeed) Else ' User clicked the Cancel button End If frm2.Refresh() End If End Sub
My 2 issues:
1. The dialog box does not close when the user clicks the "ok" or "cancel" button. (It does close when clicked a 2nd time)
2. I do not see any ouput from my Debug.WriteLine("Speed: " & frm3.MySpeed) statement for frm3.MySpeed
Thanks for your help in advance


Reply With Quote
