25-08-22, 03:59 AM
اضفت زر بحث عن كلمة في مربع النص
ليكون كود البحث كامل فالمثال تنقصه جزئية بسيطة وهي عمل سكرول لنتيجة البحث سواءا اعلى او اسفل:
PHP كود :
txtlines.ScrollToCaret()
والتالي كل كود البحث مع الجزئية الناقصة:
PHP كود :
txtlines.Focus()
txtlines.DeselectAll()
Dim a As String = InputBox("type a thing")
If a.Trim = "" Then Exit Sub
For Each line As String In txtlines.Lines
If line = a Then
txtlines.SelectionStart = txtlines.Text.IndexOf(a)
txtlines.SelectionLength = a.Length
txtlines.ScrollToCaret()
Exit Sub
End If
Next
MsgBox("NOT-Found", MsgBoxStyle.Critical, "")