Results 1 to 2 of 2

Thread: Find Text

Threaded View

  1. #1

    Thread Starter
    Addicted Member Rally2000's Avatar
    Join Date
    Dec 2003
    Location
    Central USA
    Posts
    134

    Find Text

    Hi all!
    I’m in need of some assistance, and I hope that someone will explain this to me.
    I have added a search feature to my Text Pad but I cannot find any reference for what I’m trying to do.
    The first thing is a check box that when checked, will only display an exact match.
    The next thing would be 2 radio buttons in a group box. Obviously, one of which is up and the other one is down. And maybe, if someone feels like explaining it, I would also like to know how I can replace all instances of a word at one time.
    Here is the code that I'm using now.
    VB Code:
    1. Private Sub cmdFind_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdFind.Click
    2.         Dim fMain As New frmMain
    3.         fMain = CType(Me.Owner, frmMain)
    4.         Dim lstr As String = fMain.tb1.Text()
    5.         Dim lstrFind As String = cmbFind.Text
    6.         Dim lintSelStart As Int64 = lstr.IndexOf(lstrFind, lintLastIndex)
    7.         If lintSelStart = -1 Then
    8.             fMain.tb1.Select(0, 0)
    9.             lintLastIndex = 0
    10.         Else
    11.             fMain.tb1.Select()
    12.             fMain.tb1.Select(lintSelStart, lstrFind.Length)
    13.             lintLastIndex = lintSelStart + 1
    14.         End If
    15.  
    16.     End Sub
    17.  
    18.     Private Sub cbCase_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbCase.CheckedChanged
    19.         If cbCase.Checked Then
    20.             'To do: need code to display only exact match
    21.         End If
    22.     End Sub
    23.  
    24.     Private Sub cmdReplace_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdReplace.Click
    25.         Dim fMain As New frmMain
    26.         fMain = CType(Me.Owner, frmMain)
    27.         fMain.tb1.SelectedText = tbReplace.Text
    28.     End Sub
    29.  
    30.     Private Sub cmdCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCancel.Click
    31.         Me.Close()
    32.     End Sub

    Thanks in advance for any help!
    Last edited by Rally2000; Mar 5th, 2004 at 02:42 AM.
    Code:
    Dim R1 As Fast 
    Dim Kawasaki As crap
    Dim rash As necessary
    If Kawasaki onRoad = True Then
        R1.runoverKawasaki
    Kawasaki = rash

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width