VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Absolute EASIEST Way To Find And Replace Text in Any Control

by !nnovation Software (4 Submissions)
Category: String Manipulation
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (7 Votes)

Absolute Easiest Way To Find And Replace Text in Any Control - ie: labels, textboxes, basically ANY control that supports text editing!!

Inputs
just make 3 textbox's and a command button, leave default names.
Assumes
uses the Replace function in VB6.

Rate Absolute EASIEST Way To Find And Replace Text in Any Control

Private Sub Command1_Click()
Text1.Text = Replace(Text1.Text, Text2.Text, Text3.Text, 1, , vbTextCompare)
'here's how it works:
  ' where text1.text is , thats the source of what ur looking in, ex: a label or text box
  ' where text2.text is , that's what u are looking for
  ' where text3.text is , thats what u want to replace what u find with
  ' leave everything else alone after that
  
  
Text2.Text = "Find What?"
Text3.Text = "Replace With What?"
End Sub
Private Sub Form_Load()
Text2.Text = "Find What?"
Text3.Text = "Replace With What?"
Text1.Text = "Type Text in Here"
End Sub

Download this snippet    Add to My Saved Code

Absolute EASIEST Way To Find And Replace Text in Any Control Comments

No comments have been posted about Absolute EASIEST Way To Find And Replace Text in Any Control. Why not be the first to post a comment about Absolute EASIEST Way To Find And Replace Text in Any Control.

Post your comment

Subject:
Message:
0/1000 characters