Is there a way to get a value returned from the dialog? I want to know if the user pressed OK or Cancel. I know I can setup a global variable in frmColorPicker. Is this the only way?
Dim dlgColorPicker As New frmColorPicker
Dim iRet as VbMsgBoxResult
iRet = dlgColorPicker.ShowForm
In frmColorPicker:
Code:
Private m_ReturnVal as VbMsgBoxResult
Public Function ShowForm() As VbMsgBoxResult
Me.Show vbModal
ShowForm = m_ReturnVal
End Function
Private Sub cmdOK_Click()
m_ReturnVal = vbOK
End Sub
Private Sub cmdCancel_Click()
m_ReturnVal = vbCancel
End Sub