vba 中用户窗体弹出的代码如下:
第一种:
宋体".Name = ".Font,添加控件你自己应该会做吧.Font.Bold = False
End If
End Sub
Private Sub chbFont_Click() ‘宋体复选框
If chbFont = True Then
TextBox1.Font.Name = ":
Private Sub chbBold_Click() ‘加粗复选框
If chbBold = True Then
TextBox1.Font.ForeColor = &HFF&
Else
TextBox1;黑体".Bold = True
Else
TextBox1;
End If
End Sub
Private Sub chbRed_Click() ‘红色复选框
If chbRed = True Then
TextBox1;
Else
第二种:
代码如下,添加控件你自己应该会做吧:
Private Sub chbBold_Click() ‘加粗复选框
If chbBold = True Then
TextBox1.Font.Bold = True
Else
TextBox1.Font.Bold = False
End If
End Sub
Private Sub chbFont_Click() ‘宋体复选框
If chbFont = True Then
TextBox1.Font.Name = "宋体"
Else
TextBox1.Font.Name = "黑体"
End If
End Sub
Private Sub chbRed_Click() ‘红色复选框
If chbRed = True Then
TextBox1.ForeColor = &HFF&
Else
TextBox1.ForeColor = &H0&
End If
End Sub