Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Need Help With Rich Textbox With Colors Things Look Please


ok here what i want to do like if there a word in the rtf Called Port I want the word port to be Blue and other words can someone in here please help me with this?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Get Colors Of Rich Edit Box
hi...
can someone pls tell me if there is a way where i can read the text of a rich text field which is written each word ina different color...
the input text in the rtf is something like "this is the text"..where :
thi->red
s is->green
the t->blue
ext->yellow
is there anywasy i can read it and get all the colors and what letter are of what color???
tks a lot...

Rich Text Box && Colors
I have a problem with rich text box and it's colors.

I am doing a html- editor and i want to work it so that when the user writes a command <br> for example, then it should change color and when user keeps writing the text comes black again. So every command should have own color and only commands have colors.

Of course different commands must have different colors.

So how to do that??

Rich Text Box Colors
Each time I add new text to the text box, it changes everything else to the color of the first line.

Code:
With RTB
.selstart = len(.text)
.text = .text & Info
.sellength = len(.text) - .selstart
.selcolor = vbRed
End with
When I add the text, only that line is red and all the previous lines go back to the color the first line is (which is cyan). Is there a way to have the previous lines keep their color when I add new lines without using the RTB code?

Also, is there a way to keep the RTB from scrolling to the top each time I add text?

Colors In Rich Text Box
What is the best way to do this? The methods I have seen work good with small amounts of data, but when the textbox gets large, it tends to lag a whole lot..

Colors In A Rich Text Box
I have a chat application I made in VB . The main window is a richtextbox . I want to add color to the "Nick" the person is using and I tried this

Code:
Public Sub colorize()
Dim posEnd, posStart, x, i As Integer

x = 0
i = 0

For i = 0 To Len(RichTextBox1.Text)
RichTextBox1.SelStart = i
RichTextBox1.SelLength = 1

If RichTextBox1.SelText = ">" Then 'start tag
posStart = i
RichTextBox1.SelColor = vbRed

End If

Next i

End Sub

The Probem with that is that evertime something new is put in the box it scrolls through the whole RTB contents and it looks ugly . How do they do it in Mirc ? Should I write all the chat strings to a file and reload it evertime something new is entered ? Any ideas would be great ! Thanks again .

Colors In A Rich Text Box...
Is there a way to set the color of the text inside a rich text box? As far as I can tell, the properties of the rtb only allow you to set the background color.

To start, I'd like to be able to set the text color inside the rtb. I'd like to be able to set each line in the box to a different color if possible.

Any help would be greatly appreciated!

Thanks

Rich Text Box And Colors?
Ok here is my code:
Private Sub cmdsend_Click()

    rtb1.SelColor = vbBlue
    rtb1.SelText = TheMessage & vbCrLf
    rtb1.Text = txt1.Text + txt2.Text
    
End Sub

-----------------------------------------------------
Private Sub cmdsend1_Click()
   
    rtb1.SelColor = vbRed
    rtb1.SelText = TheMessage & vbCrLf
    rtb1.Text = txt2.Text + txt1.Text

End Sub
Now i need to when i'm inserting text from one text box appearance of that text in rtb1 needs to be blue, and when i'm inserting from another text box, appearance of that text needs to be red, can someone help pls? Thank you



Edited by - sdimoti on 2/24/2005 2:38:44 AM

Rich-Text Box: Need Help Giving Different Colors To A String. Plz Help
hi there,. ok here is what im trying to do:

Im working on a MUD, and when i got to the client part, well, i realized i needed to use rich-text box, control im not familiarized with,... i have been trying and trying to give a string different colors in different parts of the same, and i really cant do it.

For example i want this string:
[3Hello [2World.

to give different colors to both words... Get the idea? so what im trying to do is pretty much the same as alt+k command on mIRC. Make it so i can change the font's color anytime i want in the same line, etc.



I would really appreciate if someone can tell me how this can be done, or if it has some default tags, i would love if you can give me a list or a place where i can get those tags from.


Thanks a Lot, Bruno

I Added A Rich Text Box, Now I Cant Save My Colors Anymore
My colors were saving to registry, then I put rich text box in and now nothing saves. I commented out the rich textbox lines but it still doesnt save. I have ran through the debugger and cant seem to find the problem. Here is the code in the order it loads.

Load form

Code:
Code:Private Sub Form_Load()
Call GetControls
end sub

Get saved options

Code:
Code:Cllr7 = CLng((GetSetting(App.Title, "Colors", "FBible", Cllr7)))
If Cllr7 = "" Then
frmBible.txtBible.SelColor = vbBlack
Else
frmBible.txtBible.SelColor = Cllr7
End If
Cllr8 = CVar((GetSetting(App.Title, "Colors", "FNotes", Cllr8)))
frmBible.txtNotes.ForeColor = Cllr8
**********THESE 2 SHOULD BE DIFFERENT COLORS********


Change Colors
Code:
Code:Private Sub Command1_Click()

   
    If chkAFC.Value = 0 And chkNFC.Value = 0 And chkBFC.Value = 0 Then
MsgBox "You must check at least one box to have your selection take effect"
End If
If chkAFC.Value = 1 Then
NewFace &HFF00&
End If
    If chkNFC.Value = 1 Then
    NewFNotes &HFF00&
    End If
        If chkBFC.Value = 1 Then
        NewFBible &HFF00&
        End If

End Sub

Private Sub NewFNotes(FN As Long)
frmBible.txtNotes.ForeColor = FN
End Sub

Private Sub NewFBible(FB As Long)
'frmBible.txtBible.SelColor = FB
End Sub
Save Colors

Code:
Code:Private Sub cmdSave_Click()

    'check witch text box to apply settings to
    If chkBibletxt.Value = 1 And chkNotestxt.Value = 1 Or chkBibletxt.Value = 0 And chkNotestxt.Value = 0 Then
    Call Tbible
    Call TNotes
    Else
    If chkBibletxt.Value = 1 And chkNotestxt.Value = 0 Then
    Call Tbible
    Else
    If chkBibletxt.Value = 0 And chkNotestxt.Value = 1 Then
    Call TNotes
    End If
    End If
    End If
    Call SaveControls
End Sub
Calling save control

Code:

Code:Cllr7 = frmBible.txtBible.SelColor
Cllr8 = frmBible.txtNotes.ForeColor

SaveSetting App.Title, "Colors", "FBible", Cllr7
SaveSetting App.Title, "Colors", "FNotes", Cllr8

Well there it is thats the end and then obviously once the settings are saved and you restast the app it should recall the colors. It was working before now I cant seem to get it to save. It wont save the richtextbox color or the notes or anything elses color.

anyone see an error I am missing somewhere.

Thanks,
Doc

Moving Things From A Listview To A Textbox?
Hey guys I have a listview called report and it has check boxes. I have another form called form2 with a text2.text.

Is there a way when I check one item and press a button that checked item goes in the text2 of the form2?

Its just the item from the first column of the report listivew.

Thanks!

Background Image In My Textbox Or Rich Textbox
I need to place a background image in a textbox or rich textbox as well. Is there no API or GDI(?) solution?

Background Image In My Textbox Or Rich Textbox
i would like to place a fixed background image in my textbox or rich textbox so it will act like a watermark. is that possible? please help.

i tried to use an rtf file template with image on it but everytime the rich textbox is updated the image is removed from view. i would like to remain on its position.

thank you very much. :P

Add Colored Text To Textbox Or Rich Textbox
Is there is script to make it add in a textbox the same text that is in the same text box plus some other colored text. eg

Before:

Code:
text

RichTextBox1.Text = RichTextBox1.Text + textFormated(&Hff,"lol")
After:

Code:
textlol

RichTextBox1.Text = RichTextBox1.Text + textFormated(&Hff0000," test")
After:

Code:
textlol test

2 Small Things (change Image And Textbox Value)
I just have 2 small questions:

1. How can I make my image (lets call it PictureBox1) change when I make a selection on combobox1. I have about 16 different images to go with the 16 different options.

2. How can I make it so that when I press a button [I just need the code for the following], it changes the value of a textbox on another form, and shows the tab that form is on?

Thanks!

Things Were Okay UNTIL I Changed From Picturebox To Textbox For Output Display
Things were okay until I changed from picturebox to textbox for output display ---> Originally I was using a picturebox of which all 10 lines from a textfile displayed a-ok ... but then I changed over to textbox because I needed a scrollbar as picturebox does not have that ... now the 10 lines will not print, ONLY the very last line does ... Will someone please show me how to correct the code below to display the 10 lines of textfile instead of just the very last one?

The only change I made was I replaced Picture1.Print SampleOutput to Text3.Text = SampleOutput


Quote:




Private Sub Command2_Click()
'Runs loop to read and display all 10 lines from text file.
Open "C:My Documentsmytext.txt" For Input As #1
Do While Not EOF(1)
Input #1, SampleOutput
Text3.Text = SampleOutput
Loop
Close #1
End Sub




P.S. Why is it when I insert code indented as it should be, it comes out all left-justified when posted?

TextBox Colors
is there no way of adding different colors text to a standard textbox ? i seen it done with a listbox

Different Colors In A Textbox
I need to produce a text, which will show a log of a procedure. The normal headers should be in black, but I would like to view the errors in red. How can I do this ?

Different Colors In Same Textbox
I have a question about textboxes. Is it possible to have different text colors in the same textbox? Because the only way i see to change the color is by using the forecolor property, which changes the color of the whole text. Im wondering if you could change the color of only part of it.
Thanks in advance for any help

Textbox With Multple Colors
how to create a textbox with text that can have different colors at the same time (like <font color=#xxxxxx>text</font> in HTML)

or whatelse to use to achieve that??????

Textbox And Font Colors
How do I have different text in the same textbox different colors?

Example:

DodgeRida67: Hello

I would want Dodgerida67 is red and hello in black. Thanks.

Random Colors In Textbox
Hi there..

Is there a simple code for getting random colors and using them in a textbox?

thanks in advance..

Question On Colors In Textbox
In a textbox I have soem text then a >> and then some more text. I want the text before the >> to be one color and the text after it to be another color. How would I do this?

Multiple Colors In A Textbox...
To keep it simple, i want the local text sent (by winsock) to show up as one color in a text box, and the remote text to appear as a different color. Any ideas?
Jared

Different Text Colors In Textbox
I need a way to Highlight bits of text in a TextBox / Rtf control / Label or anything else that could be used for display purposes only. Idealy I would like the normal text in one color, with the highlighted text in a different color.
Is there a way of doing this?.

Format TextBox Colors As You Type
hi,

can anyone tell me how do i change the colors of the partial text in my rich text box.

what i mean is, when i type i want the program to audit whatever i type and change the color of words (i'll have these words predefined).

just like VB editor, when you type a keyword it's being changed to another color for clarity and validation.

please help, or push me in the right direction.

Rich Textbox
Simple question, how do you make/add a rich text box to a form....


Thanks

Rich Textbox Help
what do i have to do to be able to get the rich text box on my form???

also i get an error saying wrong connection state when i do this:


winsock1.connect

dim s as string

s = "c"

winsock1.SendData s


is there anyway to pause the program maybe until the connection state is updated.....i dont know

thanks for the help

Rich Textbox
Im making a ftp program and i have a rtf text box which prints all the messages sent and received, but my problem is that the text always appears at the top of the box and i want to make it appear at the bottom of the box. I believe im using .seltext or something like that to show the text.
Thanks

(rich?)TextBox Help
I need some help.. I'm trying to make a psuedo chat program for a friend and i'm rather new.. I have the user entering text in on text box and once they press "send" it goes into another textbox so it looks like a dialog. My own problem is that with a textbox or RichTextBox, once the text goes below the bottom of the textbox, the scrollbar comes up but the text still stays at the very top so what you just pasted is not visible and you must scroll manually. Is there any way to change this? I'm currently using code like "rtfChatwindow.text = rtfChatwindow.text + chr(10) + txtEntertext.text" incase that has anything to do with it

[B]Rich TextBox Help....[/B]
Problem 1 :
I'm using RT for a chat application and I want it automatically scroll til the end of the conversation so that the recent conversation is visible. Or else we have to scroll till the end and then read.
How can I achieve this??

Problem2 :
I want to use multiple coloures. i.e- Other username in one colour and my username in another colour. Like (Yahoo Mess).
How can I achieve this...

Waiting for your help.

Thanks...

GIF In Rich TextBox
Hello
Can I put a GIF picture in Rich TextBox? how?

Thanks

Rich Textbox
Dear Team,
While Loading a Long Text file into a Rich text box, the RTB Flickers.How to hide this Flickering.

Thanks in Advance

Rich TextBox
I need help with the code for making the RichTextBox change to a different style (Like Italic, Bold, Underline and Strikeout).
If anyone has it just post here thanks.

Rich TextBox
Ok i have a rich textbox and when the user highlights an area wish to insert text at the start and end of the highlighted area!

How is this possible? with properties would i need to look at?

thanks

Rich TextBox
i want to do something like this

Private Sub Command1_Click()

RichTextBox1.TextRTF = RichTextBox1.TextRTF & vbcrlf & RichTextBox2.TextRTF

End Sub

but it doesnt work, any idea?

Rich Textbox....
OK here's the code...


VB Code:
Dim x As New OLEObjectr1.OLEObjects.Add , , "d:heq.bmp"'r1.AutoVerbMenu = Falser1.SelStart = Len(r1.SelText)Set x = r1.OLEObjects.Add(, , "d:java.gif")


This is successfully embedding bmp and gif into RichTextbox but when adding GIF.. it is also opening the program gif file is associated with..
Is there any way to stop this program from opening?

Rich Textbox
Is there a way to progam a richtextbox control to know what column and what row the user is in on the control?

Is there a way to have 70 spaces instantly calculated towards the maxlength when enter is hit?

Any help would be appreciated.

Doc

Rich Textbox
Hi,

Please see my code and tell me how to align all the elements(from a database) into the richtextbox properly.

Rich Textbox
How do i get a Rich TextBox ?

Rich Textbox
can i use the listbox or the combo box to display the text files in the rich text box and how?

Rich Textbox
U should get u'r hands on CodeMax. Its free and powerful indeed.
do a search for CodeMax.

Rich Textbox
When I open a plain text file in Wordpad it retains the tabs spacing the file has but when I open it in my RT box it doesn't. Anyone know what I need to change?
Thanks

Rich Textbox
Hey,

How would I go about saving the contents of a rich textbox to a normal acsii text file, that can be read in notepad?

It's probably an easy solution I just don't know it.

Any and all help is appreciated.

Rich TextBox
I have richtext boxes which I insert phrases from a grid list into..
The boxes aren't to big so after a couple of phrases it gets the visible part full and fills bellow.. I want to see the phrases when i add them from my grid.. so i want it to scroll down to the phrase i addes !!

I hope this make sense for ya !!

Rich Textbox
I want to justify the text placed in a rich textbox.
Help me out.

Rich TextBox
I am writing a Notepad style program in VB, using the RichTextBox control. However I need to dissable OLE dropping in the box. I can dissable the drag-drop of OLE objects by setting that property to false during design-time, however, it still allows me to paste OLE objects into the box at runtime. For example, if i would right click a file and click copy, then go to the rich textbox and press Ctrl-V(for paste), an icon for the copied file will appear in the textbox. How can I prevent this from happening?

Rich TextBox
Hi all,

I’ve got a problem. I’ve written a program on wich I like to create reports
in RTF how can I code that each line I put in a rtfbox wil have it’s own
format/makeup.



Joost

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.333 / Virus Database: 187 - Release Date: 8-3-2002

Rich Textbox
In my project I have a treeview,Listbox and a Rich textbox.


1)My rich textbox functions as a text editor.How can I insert a copied text from another file to the Rich textbox.I mean inbetween paragraphs or words in the rich textbox??

2)I want to show WinExploer(API) in side a frame/imagebox on a form. Any help/advice?(so It's look like a treeview on a form)

3)I created a VB6 Project in Win 2000 Pro. I have used date,string functions in the project. When I run the source code in Win 2000 Server ;The compiler does not recognize the string functions(trim/ucase).Why?I have installed VB6 pro on this machine.

Thanks in advance for VB Gurus

Rich Textbox
Hi all,
how do i use the dataformat?
i mean i defined the dataformat to :date,but there is no change when i'm filling the rich text....
thanks,

Copyright © 2005-08 www.BigResource.com, All rights reserved