954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

RichTextBox Not Reading Character

Is there anyway, I can have my richtextbox display this character("•") with it showing the box like shape(when the richtextbox doesnt know how to read the character)?

GAME
Junior Poster
166 posts since Mar 2010
Reputation Points: 5
Solved Threads: 1
 

Well first of all what character is that?

finito
Nearly a Posting Virtuoso
1,321 posts since May 2010
Reputation Points: 60
Solved Threads: 135
 

? It is one of those press a combo of button of keys

GAME
Junior Poster
166 posts since Mar 2010
Reputation Points: 5
Solved Threads: 1
 

hmm try

char c = Convert.ToChar("•");
RTB.Text += c;
finito
Nearly a Posting Virtuoso
1,321 posts since May 2010
Reputation Points: 60
Solved Threads: 135
 

where shall I drop that code?

Im using this code to get text, that has the "•"

void readrss()
        {
            try
            {
                richTextBox1.Text = string.Empty;
                StreamReader x = new StreamReader(WebRequest.Create("http://www.cheatingzone.net/News.txt").GetResponse().GetResponseStream());
                richTextBox1.Text += x.ReadLine();
                x.Close();
            }
            catch { }
            Thread.CurrentThread.Abort();
GAME
Junior Poster
166 posts since Mar 2010
Reputation Points: 5
Solved Threads: 1
 

I could solve this for you but this is where programming comes into play.

This is where your logic comes into play.

Show me your thought process. give me your psuedo code.

finito
Nearly a Posting Virtuoso
1,321 posts since May 2010
Reputation Points: 60
Solved Threads: 135
 

How would I make it replace a character? All that does is add one, I need to replace a character?

GAME
Junior Poster
166 posts since Mar 2010
Reputation Points: 5
Solved Threads: 1
 

hmm, Indexof(), Replace, and Substring() are your friend.

finito
Nearly a Posting Virtuoso
1,321 posts since May 2010
Reputation Points: 60
Solved Threads: 135
 

Would you be able to give me an example of replacing < with •

GAME
Junior Poster
166 posts since Mar 2010
Reputation Points: 5
Solved Threads: 1
 

Well,

int Marker = yourstring.IndexOf('<');
char c = Convert.ToChar("•");
if (Marker != -1)
     yourstring = yourstring.Substring(0, Marker-1) + c + yourstring.SubString(Marker+1, yourstring.Length-Marker);


Not sure about the -1 or +1 test it out.

finito
Nearly a Posting Virtuoso
1,321 posts since May 2010
Reputation Points: 60
Solved Threads: 135
 

There is a error for SubString

EDIT: correction, its suppose to be Substring. fixed,.

EDIT 2: The < is still there, what should I do ?

GAME
Junior Poster
166 posts since Mar 2010
Reputation Points: 5
Solved Threads: 1
 

Comon I gave you the clues.
Not sure about the -1 or +1 test it out.

Here

label1.Text = label1.Text.Substring(0, Marker ) + c + label1.Text.Substring(Marker+1, label1.Text.Length - Marker-1);
finito
Nearly a Posting Virtuoso
1,321 posts since May 2010
Reputation Points: 60
Solved Threads: 135
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You