# 小吴 , cww ,everybody 帮个忙好吗 ?

Posted by S.W.U on March 05, 1999 at 15:35:34:

有2个 programs 应该有一样的结果 , 但却不是 Why ???????????/

program 1:

Private Sub Form_Click()
Dim Search, Where
Search = InputBox("Enter text to be found:")
Where = InStr(Text1.Text, Search)
If Where Then
Text1.SelStart = Where - 1
Text1.SelLength = Len(Search)
Else
MsgBox "String not found."
End If
End Sub

Private Sub Form_Load()
Text1.Text = "Two of the peak human experiences"
Text1.Text = Text1.Text & " are good food and classical music."
End Sub

***************************************************************

program 2 :

Private Sub Command1_Click()
Dim Search, Where
Search = InputBox("Enter text to be found:")
Where = InStr(Text1.Text, Search)
If Where Then
Text1.SelStart = Where - 1
Text1.SelLength = Len(Search)
Else
MsgBox "String not found."
End If
End Sub

Private Sub Form_Load()
Text1.Text = "Two of the peak human experiences"
Text1.Text = Text1.Text & " are good food and classical music."
End Sub

为什么第二个 Program 无法highlight 呢

program 2:

Follow Ups:

- Re: 小吴 , cww ,everybody 帮个忙好吗 ? jutso 16:46:54 3/05/99 (0)