|
-
Jul 25th, 2003, 09:54 PM
#1
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:
Private Sub mnuChildFIndandReplace_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuChildFIndandReplace.Click
'Show The Find And Replace Dialog
Dim frmReplace As New frmReplace
Me.AddOwnedForm(frmReplace)
frmReplace.ShowDialog()
CurrentToBe = frmReplace.txtReplaceThis.Text
CurrentReplace = frmReplace.txtReplaceWith.Text
Dim CharacterNumber As Integer = frmReplace.txtReplaceThis.Text.Length()
If frmReplace.chkCase.Checked = False Then
ReplaceWordLocation = txtBoxChild.Find(CurrentToBe, RichTextBoxFinds.None)
txtBoxChild.Text.Remove(ReplaceWordLocation, CharacterNumber)
txtBoxChild.Text.Insert(ReplaceWordLocation, CurrentReplace)
ElseIf frmReplace.chkCase.Checked = True Then
ReplaceWordLocation = txtBoxChild.Find(CurrentToBe, RichTextBoxFinds.MatchCase)
txtBoxChild.Text.Remove(ReplaceWordLocation, CharacterNumber)
txtBoxChild.Text.Insert(ReplaceWordLocation, CurrentReplace)
End If
End Sub
Last edited by Kasracer; Jul 26th, 2003 at 12:40 PM.
-
Jul 26th, 2003, 11:41 AM
#2
Addicted Member
Is there a reason you're not using the built in Replace function?
-
Jul 26th, 2003, 12:24 PM
#3
Originally posted by Sheppe
Is there a reason you're not using the built in Replace function?
I tried it and it wouldn't work.....
-
Jul 26th, 2003, 12:31 PM
#4
instead of using txtBoxChild.Text.Replace( blabla , blabla )
try this :
VB Code:
txtBoxChild.Text = Replace( txtBoxChild.Text , "exsisting text " , " New Text " )
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Jul 26th, 2003, 12:40 PM
#5
Originally posted by dynamic_sysop
instead of using txtBoxChild.Text.Replace( blabla , blabla )
try this :
VB Code:
txtBoxChild.Text = Replace( txtBoxChild.Text , "exsisting text " , " New Text " )
Thanks that works!
I tried the replace function with the text box control and several other things and it just wouldn't work! bah.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|