New line in textbox?
-
Hi. I'm using a TextBox to display status messages to the user (like: "Retrieving MAC address: 002345235cbd" "Retrieving IP-number: 10.10.10.10" and so on). The messages are added line by line so that the first message is never over written. The only way I have found to be able to control when to get a new line is to use a String array and the set_Lines method, since neither \n, \v or \f has the desired effect. Is there no better way? The main problem using the TextBox->set_Lines method is that all the lines are set at the same time so I can't have different fontstyle on different lines. Anyone has a solution? Or should I use something else than TextBox to display the messages? If so what? Regards /EnkelIk
-
Hi. I'm using a TextBox to display status messages to the user (like: "Retrieving MAC address: 002345235cbd" "Retrieving IP-number: 10.10.10.10" and so on). The messages are added line by line so that the first message is never over written. The only way I have found to be able to control when to get a new line is to use a String array and the set_Lines method, since neither \n, \v or \f has the desired effect. Is there no better way? The main problem using the TextBox->set_Lines method is that all the lines are set at the same time so I can't have different fontstyle on different lines. Anyone has a solution? Or should I use something else than TextBox to display the messages? If so what? Regards /EnkelIk
Environment.NewLine is the .NET friendly way to make something multiline, and make sure the text control is set to multiline also. Christian Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
-
Hi. I'm using a TextBox to display status messages to the user (like: "Retrieving MAC address: 002345235cbd" "Retrieving IP-number: 10.10.10.10" and so on). The messages are added line by line so that the first message is never over written. The only way I have found to be able to control when to get a new line is to use a String array and the set_Lines method, since neither \n, \v or \f has the desired effect. Is there no better way? The main problem using the TextBox->set_Lines method is that all the lines are set at the same time so I can't have different fontstyle on different lines. Anyone has a solution? Or should I use something else than TextBox to display the messages? If so what? Regards /EnkelIk
Yes, I can't find a better way than using strings and then doing something like: String* break="\r\n"; String::Concat(textString1,break,textString2); This is obviously a lousy solution because you have to put all of your strings together before you even display them! MS says that we shouldn't even be using strings anymore if they have to be manipulated repeatedly, but should use stringBuilder instead. Unfortunately, stringBuilder has been proven in clinical trials to cause insanity in 3 out of 5 users.