Click here to Skip to main content
16,010,482 members
Home / Discussions / C#
   

C#

 
GeneralRe: running application Pin
EliottA9-Jan-09 10:50
EliottA9-Jan-09 10:50 
GeneralRe: running application Pin
abu rakan9-Jan-09 10:56
abu rakan9-Jan-09 10:56 
GeneralRe: running application Pin
EliottA9-Jan-09 11:02
EliottA9-Jan-09 11:02 
GeneralHere's your "reply" Pin
leckey9-Jan-09 11:10
leckey9-Jan-09 11:10 
AnswerRe: running application Pin
#realJSOP9-Jan-09 11:02
professional#realJSOP9-Jan-09 11:02 
AnswerRe: running application Pin
DaveyM699-Jan-09 12:32
professionalDaveyM699-Jan-09 12:32 
Generalyou asked for it Pin
Luc Pattyn9-Jan-09 13:07
sitebuilderLuc Pattyn9-Jan-09 13:07 
QuestionText.Length Command Pin
asquaredtech9-Jan-09 8:51
asquaredtech9-Jan-09 8:51 
I am using C# 2008 express. When I do a textBox.Text.Length it does not count escape sequence characters in the string ex."\r\n" has length of 2 instead of 4. I am trying to have a console window show what line of a file I am sending, I use the Text.Remove command to remove the previous string that displays the last count, and append the new string that show the current count.

Ex..
textBoxConsole.Text = "Sending File....\r\n";
int len = textBoxConsole.Text.Length;
for (int i = 0; i <= 3; i++)
{
    textBoxConsole.Text.Remove(len - 1);
    textBoxConsole.AppendText("Line 1 of 3");  // this is actually a counter
}

The above code will produce the following string:
"Sending File....\rLine 1 of 3"
The "\n" is cut off because the length was not correct. If there is more text above this more characters will be cut off because of ignored "\"s.

If anybody has a better way to do this please let me know.

Thanks!
AnswerRe: Text.Length Command Pin
JByrd20069-Jan-09 8:58
JByrd20069-Jan-09 8:58 
GeneralRe: Text.Length Command Pin
asquaredtech9-Jan-09 9:15
asquaredtech9-Jan-09 9:15 
GeneralRe: Text.Length Command Pin
Colin Angus Mackay9-Jan-09 10:19
Colin Angus Mackay9-Jan-09 10:19 
AnswerRe: Text.Length Command Pin
Eddy Vluggen9-Jan-09 9:13
professionalEddy Vluggen9-Jan-09 9:13 
GeneralRe: Text.Length Command Pin
asquaredtech9-Jan-09 9:18
asquaredtech9-Jan-09 9:18 
GeneralRe: Text.Length Command Pin
Guffa9-Jan-09 17:19
Guffa9-Jan-09 17:19 
GeneralRe: Text.Length Command Pin
asquaredtech9-Jan-09 19:05
asquaredtech9-Jan-09 19:05 
GeneralRe: Text.Length Command Pin
Guffa9-Jan-09 19:54
Guffa9-Jan-09 19:54 
GeneralRe: Text.Length Command Pin
Luc Pattyn9-Jan-09 9:31
sitebuilderLuc Pattyn9-Jan-09 9:31 
GeneralRe: Text.Length Command Pin
asquaredtech9-Jan-09 10:14
asquaredtech9-Jan-09 10:14 
GeneralRe: Text.Length Command Pin
Colin Angus Mackay9-Jan-09 10:24
Colin Angus Mackay9-Jan-09 10:24 
GeneralRe: Text.Length Command Pin
Luc Pattyn9-Jan-09 10:27
sitebuilderLuc Pattyn9-Jan-09 10:27 
AnswerRe: Text.Length Command Pin
Rutvik Dave9-Jan-09 10:32
professionalRutvik Dave9-Jan-09 10:32 
AnswerRe: Text.Length Command Pin
Henry Minute9-Jan-09 10:51
Henry Minute9-Jan-09 10:51 
GeneralRe: Text.Length Command Pin
Colin Angus Mackay9-Jan-09 11:04
Colin Angus Mackay9-Jan-09 11:04 
GeneralRe: Text.Length Command Pin
Henry Minute9-Jan-09 11:28
Henry Minute9-Jan-09 11:28 
GeneralRe: Text.Length Command Pin
asquaredtech9-Jan-09 19:24
asquaredtech9-Jan-09 19:24 

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.