

Visual Basic İle Microsoft Word"De Olduğu Gibi Arama Yapma
-
Visual Basic Tıpkı word de olduğu gibi Uzun Bi Metinde İstediğiniz Cümleyi Veya Kelimeyi Arayabilirsiniz
Form üzerine 2 adet textbox yerleştirin ve 1 adet command buton yerleştirin
text1in adını = txttext
text2in adını = txttextbox olarak değiştirin
txttextbox 'un multiline özelliğini true yapın, scrollbars özelliğinide vertical olarak değiştirin
'############################################################
Public Sub ara(txttextbox As TextBox, txttext As String)
Dim intWordStart As Integer
txttextbox.SetFocus
intWordStart = InStr(txttextbox.Text, txttext)
If intWordStart <> 0 Then
txttextbox.SelStart = intWordStart - 1
txttextbox.SelLength = Len(txttext)
End If
End Sub
Private Sub Command1_Click()
ara txttextbox, txttext
End Sub
Private Sub Form_Load()
txttext.Top = 120
txttext.Left = 120
txttext.Height = 285
txttext.Width = 3855
txttextbox.Left = 120
txttextbox.Top = 480
txttextbox.Width = 3855
txttextbox.Height = 3015
Command1.Caption = "Ara ve Bulunca Seç"
Command1.Width = 3855
Command1.Top = 3600
Command1.Height = 375
Command1.Left = 120
txttext.Text = "bilgisayar"
txttextbox.Text = "the holocaust the late night hacker " & vbCrLf & "sisli teknik lisesi" & vbCrLf & "t12 bilgisayar yazılım" & vbCrLf & "copyright© 2000-2007 Tahribat Crew"
End Sub
'############################################################
'visual basic ile ilgili sorunlarınız için holocaust@w.cn adresine mail atabilirsiniz...
-
text nesnesi yerine richtextbox u kullanmak daha mantıklıdır, ms word de text i kullanmıyor richtextbox u kullanıyor :)
Toplam Hit: 1708 Toplam Mesaj: 2