j = j + 1 s = s + i End If Next i
If m = s Then IsWs = True End Function
F.7
Private Sub DeleStr(s1 As String, ByVal s2 As String) Dim i%
ls2 = Len(s2) i = InStr(s1, s2) Do While i > 0
s1 = Left(s1, i - 1) + Mid(s1, i + ls2) ' 在s1中去除s2子串 i = InStr(s1, s2) Loop End Sub
Private Sub Command1_Click() ' 调用DeleStr子过程 Dim ss1 As String ss1 = Text1
Call DeleStr(ss1, Text2) Text3 = ss1 End Sub
Private Sub Command2_Click()
End Sub
F.8
Private Sub Command1_Click() Dim maxw$
maxlen Text1 & \Text2 = maxw End Sub
Sub maxlen(s$, maxw$) Dim word$ maxw = \
Do While s <> \ i = InStr(s, \
word = Left(s, i - 1)
If Len(word) > Len(maxw) Then maxw = word s = Mid(s, i + 1) Loop
End Sub
Private Sub font16_Click() Text1.FontSize = 16 End Sub
Private Sub Form_Load() bold.Checked = False italic.Checked = False End Sub
Private Sub italic_Click()
Text1.FontItalic = Not Text1.FontItalic italic.Checked = Not italic.Checked End Sub
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 2 Then PopupMenu menu2 End Sub