|
-
Jul 11th, 2000, 02:54 PM
#1
Thread Starter
Fanatic Member
Does anyone know how to make specified phrases/word invisible in a text box? Or is it only possible if i erase them?
Thanx you,
D!m
-
Jul 11th, 2000, 03:18 PM
#2
Do you mean invisible to the User? Or invisible to the System?
-
Jul 11th, 2000, 04:23 PM
#3
Lively Member
One could use the RichText control to make the text of the phrase the same color as the background.
Consider the following:
RichText1.Text = "Now is the time for all good men to come to the aid of their country."
SearchFor$ = Inputbox("Make what invisible?")
Location = InStr(1, Ucase(Ri4chText1.Text), Ucase(SearchFor$))
If Location = 0 Then
MsgBox "That's not in the string!"
Else
RichText1.SelStart = Location
RichText1.SelLength = Len(SearchFor$)
RichText1.SelColor = &H00FFFFFF&
End If
This code sample will find the word you enter in the InputBox and make it white. If the background color of the RichTextbox control is white, the text will be invisible.
This, of course, will only change the first instance of the word. You will have to repeat the procedure with a Do While loop.
Likewise, you can delete the word by changing this:
RichText1.SelColor = &H00FFFFFF&
To this:
RichText1.SelText = ""
Hope that helps.
-Zero the Inestimable
-
Jul 11th, 2000, 07:09 PM
#4
Thread Starter
Fanatic Member
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
|