Click here to Skip to main content
15,904,416 members
Home / Discussions / C#
   

C#

 
GeneralRe: downloaded??? Pin
leppie28-Feb-05 5:44
leppie28-Feb-05 5:44 
Generalneed IExpando example Pin
Ning Hu27-Feb-05 13:23
Ning Hu27-Feb-05 13:23 
GeneralRe: need IExpando example Pin
leppie27-Feb-05 19:18
leppie27-Feb-05 19:18 
GeneralRun-Time Licensing For VB6 Controls in C# Pin
DTWC_Lawrence27-Feb-05 10:01
DTWC_Lawrence27-Feb-05 10:01 
GeneralRe: Run-Time Licensing For VB6 Controls in C# Pin
Dennis C. Dietrich27-Feb-05 11:03
Dennis C. Dietrich27-Feb-05 11:03 
Generalvery confusing formatting symbols Pin
Pyro Joe27-Feb-05 9:03
Pyro Joe27-Feb-05 9:03 
GeneralRe: very confusing formatting symbols Pin
S. Senthil Kumar27-Feb-05 11:55
S. Senthil Kumar27-Feb-05 11:55 
GeneralRe: very confusing formatting symbols Pin
Pyro Joe27-Feb-05 16:49
Pyro Joe27-Feb-05 16:49 
oops, yeah, "'" works. I meant how to insert the " symbol.
int current = 1;<br />
			int lines  = richTextBox1.Lines.GetLength(0);<br />
			if (lines < 3)<br />
			{<br />
				MessageBox.Show("You need to have atleast three lines, otherwise this application is useless", "Useless he he ;)", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);<br />
			}<br />
			else<br />
			{<br />
				richTextBox2.Text = '"' + richTextBox1.Lines[0] + '"' + " " + '+' + " " + '"' + @"\r\n" + '"' + " " + '+' + " ";<br />
				while (lines > 2)<br />
				{<br />
					richTextBox2.Text += '"' + richTextBox1.Lines[current] + '"' + " " + '+' + " " + '"' + @"\r\n" + '"' + " " + '+' + " ";<br />
					current ++;<br />
					lines --;<br />
				}<br />
				if (lines > 1)<br />
				{<br />
					richTextBox2.Text += '"' + richTextBox1.Lines[current] + '"';<br />
				}<br />
			}


what happens is, the user inputs text into the richTextBox1, and when the user clicks a button to run the above code, the code is sent to the richTextBox2. the problem is, all the code must be on one line, formatted properly on that line, and display the formatting (text) necessary for the outputted code to be useable in another application where there could potentiall be hundreds of lines of text, without manuall writing all the "\r\n"'s to format it. the problem is, what if the person puts in "\r\n" into the input richTextBox1? or what if they put in a " symbol or a ; symbol. the contents of richTextBox1 are formatted in the code above, but the problem is, where you see "richTextBox1.Lines[current]", the symbols that user inputted as described above, screw up the formatting when ouputting the text to richTextBox2.

like for instance, say I put the " symbol in richTextBox2. it will then think it has reached the end of the string to be formatted, when that is not the correct " symbol to stop at.

please help, this would be a very helpful application to people I think, atleast for me when I want to format many paragraphs so I can just paste the code for an application that needs text formatted to a textbox in such a way.
the current code I have works like a dream, except it messes up as described above when these symbols are inserted:
;
'
"
+
and possibly a couple others.

if there is no easy way you can think of, my idea was to use a regular expression, and select and replace all those symbols with "'", etc.
the problem with this is, """ doesn't work to place the " symbol to a string or insert it into a text box as text. same with the ; and other symbols. how do I do this?

hilf mir!!!,
Danke schoen,
Stephen
GeneralRe: very confusing formatting symbols Pin
leppie27-Feb-05 19:24
leppie27-Feb-05 19:24 
GeneralRe: very confusing formatting symbols Pin
Pyro Joe28-Feb-05 3:48
Pyro Joe28-Feb-05 3:48 
GeneralKeyPress ASCII/Form Container questions... Pin
new_phoenix27-Feb-05 8:09
new_phoenix27-Feb-05 8:09 
GeneralRe: KeyPress ASCII/Form Container questions... Pin
S. Senthil Kumar27-Feb-05 9:01
S. Senthil Kumar27-Feb-05 9:01 
GeneralRe: KeyPress ASCII/Form Container questions... Pin
new_phoenix27-Feb-05 9:53
new_phoenix27-Feb-05 9:53 
GeneralRe: KeyPress ASCII/Form Container questions... Pin
Dennis C. Dietrich27-Feb-05 9:03
Dennis C. Dietrich27-Feb-05 9:03 
GeneralRe: KeyPress ASCII/Form Container questions... Pin
new_phoenix27-Feb-05 9:58
new_phoenix27-Feb-05 9:58 
GeneralRe: KeyPress ASCII/Form Container questions... Pin
Dennis C. Dietrich27-Feb-05 10:49
Dennis C. Dietrich27-Feb-05 10:49 
GeneralRe: KeyPress ASCII/Form Container questions... Pin
new_phoenix27-Feb-05 11:21
new_phoenix27-Feb-05 11:21 
GeneralRe: KeyPress ASCII/Form Container questions... Pin
S. Senthil Kumar27-Feb-05 11:53
S. Senthil Kumar27-Feb-05 11:53 
GeneralAccess Registry files Pin
Anthony Mushrow27-Feb-05 7:09
professionalAnthony Mushrow27-Feb-05 7:09 
GeneralRe: Access Registry files Pin
Dennis C. Dietrich27-Feb-05 7:36
Dennis C. Dietrich27-Feb-05 7:36 
GeneralContext menu in Word using C# Pin
User 4886927-Feb-05 6:00
User 4886927-Feb-05 6:00 
Generalmultiline programmatically formatting text Pin
Pyro Joe27-Feb-05 5:15
Pyro Joe27-Feb-05 5:15 
GeneralRe: multiline programmatically formatting text Pin
Heath Stewart27-Feb-05 5:45
protectorHeath Stewart27-Feb-05 5:45 
GeneralRe: multiline programmatically formatting text Pin
Pyro Joe27-Feb-05 6:19
Pyro Joe27-Feb-05 6:19 
GeneralRe: multiline programmatically formatting text Pin
Pyro Joe27-Feb-05 6:36
Pyro Joe27-Feb-05 6:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.