我在这段代码中有这个问题:
If RichTextBox1.Font.Bold = True Then
RichTextBox1.Font.Bold = False
Else
RichTextBox1.Font.Bold = True
End If
这里我的问题:“RichTextBox1.Font.Bold = False”(这个属性是只读的),我需要一些帮助。
我在这段代码中有这个问题:
If RichTextBox1.Font.Bold = True Then
RichTextBox1.Font.Bold = False
Else
RichTextBox1.Font.Bold = True
End If
这里我的问题:“RichTextBox1.Font.Bold = False”(这个属性是只读的),我需要一些帮助。
这是一个简单的例子:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
If RichTextBox1.Font.Bold = True Then
RichTextBox1.Font = New Font(RichTextBox1.Font, FontStyle.Regular)
Else
RichTextBox1.Font = New Font(RichTextBox1.Font, FontStyle.Bold)
End If
End Sub