單選框還是復(fù)選框,單選框用Option1(XX).Value
創(chuàng)新互聯(lián)公司提供高防物理服務(wù)器租用、云服務(wù)器、香港服務(wù)器、中國電信成都樞紐中心等
判斷,true表示選中,false表示未選中
注意,添加option控件(圓形)時,最好再復(fù)制幾個搞成數(shù)組,這樣選中一個后其他的會自動取消,用于單選時很方便
'確定按鈕中的代碼,自己改下
Private Sub Command1_Click()
If Option1.Value = True Then
MsgBox "選定了" Option1.Caption
Exit Sub
End If
If Option2.Value = True Then
MsgBox "選定了" Option2.Caption
Exit Sub
End If
If Option3.Value = True Then
MsgBox "選定了" Option3.Caption
Exit Sub
End If
If Option4.Value = True Then
MsgBox "選定了" Option4.Caption
Exit Sub
End If
MsgBox "沒有選"
End Sub
Private Sub Check1_Click()
End Sub
Private Sub Check2_Click()
Label2 = Label2 Check2.Caption vbCrLf
Check2.Enabled = False
End Sub
Private Sub Check3_Click()
Label2 = Label2 Check3.Caption vbCrLf
Check3.Enabled = False
End Sub
Private Sub Option1_Click()
End Sub
Private Sub Option2_Click()
End Sub
Private Sub Option3_Click()
Label2 = ""
Label1 = "你選擇了" Option3.Caption
End Sub
前提是屬性已經(jīng)按你說的設(shè)置了
Private Sub Check1_Click(Index As Integer)
Select Case Index
Case 0
Text1.FontBold = Check1(Index).Value
Case 1
Text1.FontItalic = Check1(Index).Value
Case 2
Text1.FontUnderline = Check1(Index).Value
End Select
End Sub
Private Sub Form_Load()
Text1.Text = "單選與復(fù)選框應(yīng)用"
Text1.Alignment = 2
Text1.FontSize = 18
End Sub
Private Sub Option1_Click(Index As Integer)
Select Case Index
Case 0
Text1.FontName = "宋體"
Case 1
Text1.FontName = "楷體"
Case 2
Text1.FontName = "黑體"
End Select
End Sub
單選框可以根據(jù)它的Value屬性值來判斷;
Value = True 表示被選中
Value = False 表示未被選中
復(fù)選框可以根據(jù)它的Value屬性值來判斷;
Value = 1 表示被選中
Value = 0 表示未被選中