最近学习VB 要做一个类似写字板的小程序 但是单击按钮或者选择字体字号就会出现错误424 要求对象
注:Command1_Click() 剪切按钮 Text2 选择字体文本框Command2_Click() 复制按钮 Text3 选择字号文本框
Command3_Click() 粘贴按钮
Dim st As String
Private Sub Command1_Click()
st = txtNoteEdit.SelText
Text1.SelText = " "
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = True
End Sub
Private Sub Command2_Click()
st = txtNoteEdit.SelText
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = True
End Sub
Private Sub Command3_Click()
Text1.SelText = st
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Form_Load()
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtNoteEdit.FontName = Text2
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtNoteEdit.FontSize = Text3
End If
End Sub