hi,
i have a button and when it is clicked, a textbox's text will change. the
text, however has line breaks in it. here is my code for the button's click
event:
textBox1.Text = "You clicked the button!\n\n\n\n\nif you exit the
application (Alt+F4), you can click the button again!";
the line breaks appear as small squares. how do i display line breaks
--
Alvo von Cossel I of Germany 4 1918
You can use "\r\n" instead of "\n"
Regards,
P.Nishanthan
"Alvo von Cossel I" <Al************@discussions.microsoft.com> wrote in
message news:E2**********************************@microsof t.com... hi,
i have a button and when it is clicked, a textbox's text will change. the text, however has line breaks in it. here is my code for the button's
click event:
textBox1.Text = "You clicked the button!\n\n\n\n\nif you exit the application (Alt+F4), you can click the button again!";
the line breaks appear as small squares. how do i display line breaks
-- Alvo von Cossel I of Germany
Hi,
this happens beacause of the different ascii codes.
I had the same problem and i sloved it that way:
This is a part of a huge class, that i wrote for stream
manipulation purposes:
internal sealed class DataStreamHelper{
internal static string PrepareStringForTextBox(string StringStream){
string _ready_stream;
_ready_stream = Regex.Replace(StringStream,"\n","\r\n");
return _ready_stream;
}
internal static string ReplaceString(string InputStream,string
PatternString, string ReplacementString){
string _ready_stream;
_ready_stream =
Regex.Replace(InputStream,PatternString,Replacemen tString);
return _ready_stream;
}
}
Check out the PrepareStringForTextBox() Function. It means: Find the \n and
replac it with \r\n.
This will work...
Best Regards
Kerem Gümrükcü
Instead of explicitly saying \r\n you could use System.Environment.NewLine
instead then you donot need to worry about the different codes on different
systems.
"Alvo von Cossel I" wrote: hi,
i have a button and when it is clicked, a textbox's text will change. the text, however has line breaks in it. here is my code for the button's click event:
textBox1.Text = "You clicked the button!\n\n\n\n\nif you exit the application (Alt+F4), you can click the button again!";
the line breaks appear as small squares. how do i display line breaks
-- Alvo von Cossel I of Germany
Hi,
Two things:
Set
TextBox.MultiLine = true;
and then use Environment.NewLine to get the characters sequence that
represent a new line.
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Alvo von Cossel I" <Al************@discussions.microsoft.com> wrote in
message news:E2**********************************@microsof t.com... hi,
i have a button and when it is clicked, a textbox's text will change. the text, however has line breaks in it. here is my code for the button's click event:
textBox1.Text = "You clicked the button!\n\n\n\n\nif you exit the application (Alt+F4), you can click the button again!";
the line breaks appear as small squares. how do i display line breaks
-- Alvo von Cossel I of Germany This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Astra |
last post by:
Hi All
Could you please let me know how my ASP page can insert 1 row of data
containing line breaks into a MySQL DB.
To explain, I'm using ASP Classic > MyODBC 3.5x (Win) > MySQL 4 (Win) and...
|
by: intl04 |
last post by:
I have a memo field that is included in some Access reports I created.
Is there some way for the memo field to display nicely formatted text,
with line breaks between paragraphs? Or is it necessary...
|
by: Jason Gleason |
last post by:
I've been trying to put line breaks in a text box ("\n") but the breaks come
through as boxes in the program. I have the text box set to multline though.
Is there any way to get around this? It...
|
by: Mike |
last post by:
I need my textbox to work more smoothly with respect to line breaks.
When I have data pulled from the database into a textbox there are hard
line breaks at the end of each line (by definition how...
|
by: buran |
last post by:
Dear ASP.NET Programmers,
I am carrying the input of a textbox via querystring. When I put the value
of querstring in a label control, the line breaks are removed. The whole
text is displayed as...
| |
by: Brett |
last post by:
I'm writing something similar to this into a text file:
txtfileError.WriteLine(CurrentDateTime(1) & " Error in Sub Sub1()" & idvar &
Chr(10) & Chr(13) & ex.Message)
txtfileError.WriteLine()
...
|
by: joelbyrd |
last post by:
Didn't know exactly where to post this, but: How do I get line breaks
in a textarea? I'm pulling text from a database, and this text
definately has line breaks in it, because I
replaced all the...
|
by: ashkaan57 |
last post by:
Hi,
I am trying to put text on left and right side of the page and used:
<div>
<span>blah blah</span>
<span style="float:right">blah blah</span>
</div>
The 2nd text does go to the right but the...
|
by: Itaichuk |
last post by:
Hi
I read in several CSS tutorials that block-level elements, such as
<div& <pare rendered with an implicit line break before and
after.
I set to test this out using the following HTML:
I...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |