高手帮忙解vb的题目

2024-11-13 04:08:28
推荐回答(2个)
回答(1):

一道题50分滚缓磨还差不多

'第一题
Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case Asc("a") To Asc("z")
KeyAscii = Asc(UCase(Chr(KeyAscii)))
Case Asc("A") To Asc("大斗Z")
KeyAscii = Asc(LCase(Chr(KeyAscii)))
Case 32
Case Else
KeyAscii = Asc("*")
End Select
End Sub

'第二题
Private Sub Command1_Click()
Clipboard.Clear
Clipboard.SetText Text1.SelText
End Sub

Private Sub Command2_Click()
Clipboard.Clear
Clipboard.SetText Text1.SelText
temp1 = Text1.Text
temp2 = Text1.SelText
Text1.Text = Split(temp1, temp2)(0) & Split(temp1, temp2)(1)
End Sub

Private Sub Command3_Click()
Text1.Text = Text1.Text & Clipboard.GetText
End Sub

Private Sub Form_Load()
Command1.Caption = "复制"
Command2.Caption = "剪切"
Command3.Caption = "粘哪穗贴"
Command1.Enabled = False
Command2.Enabled = False
End Sub

Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Text1.SelLength > 0 Then
Command1.Enabled = True
Command2.Enabled = True
Else
Command1.Enabled = False
Command2.Enabled = False
End If
End Sub

回答(2):

一次提问只应该包含一个问题