
オプションボタンのオプション値を取得する方法です。
例
たとえばこのようなオプショングループ(frameSex)内にオプションボタン(optionMale、optionFemale)があるとします。
このオプションボタンのオプション値を取得し、値によって性別をラベルに表示させるには次のように記述します。
Private Sub frameSex_Click() Select Case Me.frameSex.Value Case Me.optionMale.OptionValue Me.labelValue.Caption = "男" Case Me.optionFemale.OptionValue Me.labelValue.Caption = "女" End Select End Subポイントは、オプショングループのValueプロパティです。
オプションボタンを選択したときオプションボタンのオプション値がこのオプショングループのValueプロパティに格納されます。
実行結果

スポンサーリンク