vba 中用户窗体如何弹出

2024-12-05 15:32:49
推荐回答(2个)
回答(1):

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

 

第二种:

回答(2):

代码如下,添加控件你自己应该会做吧:
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