|
-
Jan 1st, 2000, 05:58 AM
#1
Check out the RichTextBox control. It can do what you want (concerning colors of your tags). You would have to use SelColor property to assign the desired color.
Code:
Public Sub ColorTag(pRich As RichTextBox, pstrTag As String, pColor As Long)
Dim iPos As Integer
iPos = 1
iPos = InStr(iPos, pRich.Text, pstrTag)
Do While iPos
pRich.SelStart = iPos
pRich.SelLength = Len(pstrTag)
pRich.SelColor = pColor
iPos = InStr(iPos + Len(pstrTag), pRich.Text, pstrTag)
Loop
End Sub
Usage: ColorTag RichTextBox, TagToColor, Color
Example: ColorTag RichText1, "<HTML>", vbBlue
You can also use an RGB function gor the color.
For your second question you can do something like this:
Text1.SelText = "MyText"
This will insert the text where the cursor is.
------------------
Serge
Software Developer
[email protected]
ICQ#: 51055819
-
Jan 1st, 2000, 12:50 PM
#2
Junior Member
I am creating a web page editor and I would like to make the tags a seperate color from the rest of the text (like the Code windows in VB).
Also... is there a way to input text to a textbox where the curser is instead of the end?
thanks
[This message has been edited by Anthrax (edited 01-01-2000).]
-
Jan 2nd, 2000, 03:56 AM
#3
Junior Member
Thanks, it worked great, but now I have another problem.
I set the scrollbars on the ritch text box to bolth horizontal and vertical but when text reaches the edge of the box, it starts a new line.
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
|