old_goat
2010-04-14 12:15:01 UTC
I have a simple form, called from another, with a cancel and (equivalent of)
OK button in place. Both buttons have _onClick subs to set their result
status:
Me.DialogResult = Windows.Forms.DialogResult.Cancel
for the cancel button....
Using the following on the parent form,
Dim CPresult As String
CPresult = dlg.ShowDialog.ToString
the result appears to be the opposite?
i.e. the 'OK' button generates a 'cancel' state, the cancel button creates
an 'ok' state.
I know each sub is generating its own status correctly - 2 for the cancel, 1
for the ok.
What am I missing?
OK, I can changed the code to detect it the wrong way, but that's not really
what I want to do.
OK button in place. Both buttons have _onClick subs to set their result
status:
Me.DialogResult = Windows.Forms.DialogResult.Cancel
for the cancel button....
Using the following on the parent form,
Dim CPresult As String
CPresult = dlg.ShowDialog.ToString
the result appears to be the opposite?
i.e. the 'OK' button generates a 'cancel' state, the cancel button creates
an 'ok' state.
I know each sub is generating its own status correctly - 2 for the cancel, 1
for the ok.
What am I missing?
OK, I can changed the code to detect it the wrong way, but that's not really
what I want to do.