OK
とボタンだけのダイアログとして使用される WinForm がありCancel
ます。そう:
Dim sr As New SlideRangeDialog
Dim dr As Windows.Forms.DialogResult
dr = sr.ShowDialog
ユーザーが [OK] を押したかどうかを確認する If/Then があります。OK を押して検証エラーが発生した場合は、ダイアログに戻って修正する必要があります。
If dr = Windows.Forms.DialogResult.OK Then
Dim mr As Windows.Forms.DialogResult
mr = MsgBox("Click Yes to fix, No to not fix or Cancel to go " + vbCrLf + _
" back to the dialog to fix.", MsgBoxStyle.YesNoCancel)
Select Case mr
Case Windows.Forms.DialogResult.Yes
''# something
Case Windows.Forms.DialogResult.No
''# something more
Case Windows.Forms.DialogResult.Cancel
''# RIGHT HERE is where I'm having the problem.
''# I just want "Cancel" to return to the first dialog.
sr.DialogResult = Windows.Forms.DialogResult.None
End Select
Else
''#other thing
End If
機能していないように見えるのでCase Windows.Forms.DialogResult.Cancel
、最初のダイアログに戻るには何を入力すればよいですか?sr.DialogResult = Windows.Forms.DialogResult.None
イベントサブを再度上げてみました (メニュー項目からのクリックです) が、これは私が使用しているテクノロジ (VSTO リボン) では機能しません。