Results 1 to 5 of 5

Thread: What am I doing wrong? [Resolved]

Threaded View

  1. #1

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    What am I doing wrong? [Resolved]

    Just a simple find and replace... and I just can't get it to work! Ugh I know I'm doing something wrong....
    VB Code:
    1. Private Sub mnuChildFIndandReplace_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuChildFIndandReplace.Click
    2.         'Show The Find And Replace Dialog
    3.         Dim frmReplace As New frmReplace
    4.         Me.AddOwnedForm(frmReplace)
    5.         frmReplace.ShowDialog()
    6.         CurrentToBe = frmReplace.txtReplaceThis.Text
    7.         CurrentReplace = frmReplace.txtReplaceWith.Text
    8.         Dim CharacterNumber As Integer = frmReplace.txtReplaceThis.Text.Length()
    9.         If frmReplace.chkCase.Checked = False Then
    10.             ReplaceWordLocation = txtBoxChild.Find(CurrentToBe, RichTextBoxFinds.None)
    11.             txtBoxChild.Text.Remove(ReplaceWordLocation, CharacterNumber)
    12.             txtBoxChild.Text.Insert(ReplaceWordLocation, CurrentReplace)
    13.         ElseIf frmReplace.chkCase.Checked = True Then
    14.             ReplaceWordLocation = txtBoxChild.Find(CurrentToBe, RichTextBoxFinds.MatchCase)
    15.             txtBoxChild.Text.Remove(ReplaceWordLocation, CharacterNumber)
    16.             txtBoxChild.Text.Insert(ReplaceWordLocation, CurrentReplace)
    17.         End If
    18.     End Sub
    Last edited by Kasracer; Jul 26th, 2003 at 12:40 PM.

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