vb里单复选框,单选框:宋体楷体黑体,复选框:粗体斜体下划线,代码怎么写?

2024-12-14 11:20:33
推荐回答(4个)
回答1:

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 = "单选与复选框应用"

  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

回答2:

Private Sub option1_Click()
Text1.FontName = "宋体"
End Sub
Private Sub option2_Click()
Text1.FontName = "楷体"
End Sub
Private Sub option3_Click()
Text1.FontName = "黑体"
End Sub
Private Sub check1_Click()
Text1.FontBold=True
End Sub
Private Sub check2_Click()
Text1.FontItalic=True
End Sub
Private Sub check3_Click()
Text1.FontUnderline=True
End Sub

回答3:

fontname

回答4:

要不要用控件数组呢?