VB.Net TextBox Find, Replace text???

Joined
Oct 3, 2005
Messages
1
Reaction score
0
hi. i have been having a hard time figuring out how to "Find and Highlight" a string in one textbox, with a string from another text box. say, i have 3 text boxes, txtNotepad being the main body, somewhat like a notepad. on the bottom, i have 2 more TextBoxes. one for Find, txtFind, and another for txtReplace... with Find and replace, i have a button, for each. i have looked for samples, all i can find is VB 5.0 and 6.0 samples. i have updated the code, tweeked, just about everything i could and i just cant figure it out... could somebody please help me...
im new to this whole programming thing... im sure you can tell though.
-Thanks
 
ive only dabbled in .net but most vb 6. code should carry over

i would try sumin like this

dim varfindStart
dim varFindend
'integers

dim strfindword 'string

strfindword=txtfind.text

varfindstart=instr(1,txtnotepad.text,strFindWord,vbTextCompare)
varfindend= len(strFindword)

WITH txtnotepad
.SETFOCUS
.selSTART=VARFINDSTART
.SELLENGTH=VARFINDEND
END WITH
 
Last edited:
Back
Top