473,721 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multiple lines in a label

I have a textbox that I am storing as text (or as a varChar). The field has
multiple lines in it (not wrapped).

When I read it back into a multiline textbox, it works fine. But when I
read it back into a label, it shows all lines together.

Is there a way to get the Label to display the lines separately?

I could use textbox and get rid of the border and set enable to false, but
then it greys the text, which I don't want.

Thanks,

Tom.
Nov 19 '05 #1
4 8873
Tom,
Remember, line-breaks from a text box or text area are not the same
thing as an HTML line break. Basically you'll need to replace the linefeed
characters in the text box with the HTML <br>. This is a fairly
straightforward operation using the Replace() method of the string
functionality in .Net, such as
varChar.ToStrin g().Replace(Env ironment.NewLin e,"<br>")

Hope this helps,
Mark Fitzpatrick
Microsoft MVP- FrontPage

"tshad" <ts**********@f tsolutions.com> wrote in message
news:OQ******** ********@tk2msf tngp13.phx.gbl. ..
I have a textbox that I am storing as text (or as a varChar). The field
has multiple lines in it (not wrapped).

When I read it back into a multiline textbox, it works fine. But when I
read it back into a label, it shows all lines together.

Is there a way to get the Label to display the lines separately?

I could use textbox and get rid of the border and set enable to false, but
then it greys the text, which I don't want.

Thanks,

Tom.

Nov 19 '05 #2
"Mark Fitzpatrick" <ma******@fitzm e.com> wrote in message
news:u2******** ********@TK2MSF TNGP11.phx.gbl. ..
Tom,
Remember, line-breaks from a text box or text area are not the same
thing as an HTML line break. Basically you'll need to replace the linefeed
characters in the text box with the HTML <br>. This is a fairly
straightforward operation using the Replace() method of the string
functionality in .Net, such as
varChar.ToStrin g().Replace(Env ironment.NewLin e,"<br>")
Does this replace all Newlines?

Also, do I need to move the data to string or can I do it directly from
either my label control or data coming from my dataset, such as:

if not (ClientReader(" achievements") is DBNull.Value) then
achievements.te xt = ClientReader("a chievements")
achievements.To String().replac e(environment.n ewline,"<br>") ->
doesn't seem to work here
end if

or can I do it directly in the ClientReader line above?

Thanks,

Tom.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP- FrontPage

"tshad" <ts**********@f tsolutions.com> wrote in message
news:OQ******** ********@tk2msf tngp13.phx.gbl. ..
I have a textbox that I am storing as text (or as a varChar). The field
has multiple lines in it (not wrapped).

When I read it back into a multiline textbox, it works fine. But when I
read it back into a label, it shows all lines together.

Is there a way to get the Label to display the lines separately?

I could use textbox and get rid of the border and set enable to false,
but then it greys the text, which I don't want.

Thanks,

Tom.


Nov 19 '05 #3
if not (ClientReader(" achievements") is DBNull.Value) then
achievements.te xt =
ClientReader("a chievements").T oString().repla ce(environment. newline,"<br>")
end if

-or-

if not (ClientReader(" achievements") is DBNull.Value) then
achievements.te xt = ClientReader("a chievements")
achievements.te xt =
achievements.te xt.ToString().r eplace(environm ent.newline,"<b r>")
end if

"tshad" <ts**********@f tsolutions.com> wrote in message
news:eR******** ******@tk2msftn gp13.phx.gbl...
"Mark Fitzpatrick" <ma******@fitzm e.com> wrote in message
news:u2******** ********@TK2MSF TNGP11.phx.gbl. ..
Tom,
Remember, line-breaks from a text box or text area are not the same thing as an HTML line break. Basically you'll need to replace the linefeed characters in the text box with the HTML <br>. This is a fairly
straightforward operation using the Replace() method of the string
functionality in .Net, such as
varChar.ToStrin g().Replace(Env ironment.NewLin e,"<br>")


Does this replace all Newlines?

Also, do I need to move the data to string or can I do it directly from
either my label control or data coming from my dataset, such as:

if not (ClientReader(" achievements") is DBNull.Value) then
achievements.te xt = ClientReader("a chievements")
achievements.To String().replac e(environment.n ewline,"<br>") ->
doesn't seem to work here
end if

or can I do it directly in the ClientReader line above?

Thanks,

Tom.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP- FrontPage

"tshad" <ts**********@f tsolutions.com> wrote in message
news:OQ******** ********@tk2msf tngp13.phx.gbl. ..
I have a textbox that I am storing as text (or as a varChar). The field
has multiple lines in it (not wrapped).

When I read it back into a multiline textbox, it works fine. But when I read it back into a label, it shows all lines together.

Is there a way to get the Label to display the lines separately?

I could use textbox and get rid of the border and set enable to false,
but then it greys the text, which I don't want.

Thanks,

Tom.



Nov 19 '05 #4
"MWells" <outbound__at_s ygnal.com> wrote in message
news:eb******** **********@tk2m sftngp13.phx.gb l...
if not (ClientReader(" achievements") is DBNull.Value) then
achievements.te xt =
ClientReader("a chievements").T oString().repla ce(environment. newline,"<br>")
end if

-or-

if not (ClientReader(" achievements") is DBNull.Value) then
achievements.te xt = ClientReader("a chievements")
achievements.te xt =
achievements.te xt.ToString().r eplace(environm ent.newline,"<b r>")
end if

Thanks - that really helps,

Tom

"tshad" <ts**********@f tsolutions.com> wrote in message
news:eR******** ******@tk2msftn gp13.phx.gbl...
"Mark Fitzpatrick" <ma******@fitzm e.com> wrote in message
news:u2******** ********@TK2MSF TNGP11.phx.gbl. ..
> Tom,
> Remember, line-breaks from a text box or text area are not the same > thing as an HTML line break. Basically you'll need to replace the linefeed > characters in the text box with the HTML <br>. This is a fairly
> straightforward operation using the Replace() method of the string
> functionality in .Net, such as
> varChar.ToStrin g().Replace(Env ironment.NewLin e,"<br>")


Does this replace all Newlines?

Also, do I need to move the data to string or can I do it directly from
either my label control or data coming from my dataset, such as:

if not (ClientReader(" achievements") is DBNull.Value) then
achievements.te xt = ClientReader("a chievements")
achievements.To String().replac e(environment.n ewline,"<br>") ->
doesn't seem to work here
end if

or can I do it directly in the ClientReader line above?

Thanks,

Tom.
>
> Hope this helps,
> Mark Fitzpatrick
> Microsoft MVP- FrontPage
>
> "tshad" <ts**********@f tsolutions.com> wrote in message
> news:OQ******** ********@tk2msf tngp13.phx.gbl. ..
>>I have a textbox that I am storing as text (or as a varChar). The
>>field
>>has multiple lines in it (not wrapped).
>>
>> When I read it back into a multiline textbox, it works fine. But when I >> read it back into a label, it shows all lines together.
>>
>> Is there a way to get the Label to display the lines separately?
>>
>> I could use textbox and get rid of the border and set enable to false,
>> but then it greys the text, which I don't want.
>>
>> Thanks,
>>
>> Tom.
>>
>
>



Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3017
by: dmiller23462 | last post by:
So here's my problem.....I need to set up different email distributions based on which option in the following Select form has been chosen....For instance if "Putaway" is chosen it needs to email User1@here.whatever and User4@here.whatever but if "Loaded" is chosen it needs to email User2@here.whatever and User3@here.whatever, etc, etc... I'm aware that the only thing that really needs to change is the "Mail.AddAddress" line (at least...
8
3963
by: Hank Reed | last post by:
Hello, I have searched through dozens of old responses to this question but have been unable to make it work in my situation. I'm using Access 2000 We have a very old sticker printer on a serial line. Neither situation is going to be upgraded so don't suggest that. A simple sticker report takes 10 seconds to reach the printer. That is not an issue for me. But, if I want 5 copies of the same sticker, most methods I have tried...
5
2734
by: Brian | last post by:
Hello all.. Am working on an Air Hockey game... have an table loaded into a picture box. The borders of the table are slightly slanted. Am using hit testing lines with GDI+ to manipulate the puck moving around. I want the puck is bounce when it hits a border (specified by the hitlines). Retreieved some info on hit testing lines from Bob Powell's GDI+ FAQ (very useful!) but i'm fairly new at the idea of hit testing and am
3
2566
by: Hazz | last post by:
I am just beginning to design a Treeview display (winforms) for wine regions. Problem. Some wine growing regions belong to two counties. Eg. Carneros is in both Napa and Sonoma Counties. Although most nodes will have only one parent, a few will have two parents. The Treeview which seems to me to lend itself to the Windows Explorer type of app could not possibly show one file as a leaf belonging to two different parent folders. You either...
3
5777
by: retsam | last post by:
All, I'm working on an ASP.NET 2.0 (C#) page and have a question on how to build a string that includes line feeds (new lines) that displays properly on an ASP.NET page. Here's what I got: ..aspx page <asp:Label ID="LabelMoreInformation" runat="server" Text=""></asp:Label> code-behind for .aspx page
3
2116
by: MikeB | last post by:
Hello, I have a content page that is from a Master page which has 2 content panes. How do I add my forms to the content page? Each pane needs a form but you can not have multiple form tags nor can the form tages be outside of the content tags? Does this make since? Below is my source to the pages. Basically I need both content tags to have form tags.
1
3065
by: dhyder | last post by:
OK, like the title says my error is Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. I have looked into this a lot, but have not been able to find a solution to it. <%@ Page Language="c#" runat="server" debug="true" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.OleDb" %> <script runat="server"> OleDbConnection conn = new...
25
5398
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if my question needs to be here or in coldfusion. If i have my question is in the wrong section i am sorry in advance an will move it to the correct section. Basically i have a multiple select box. An it works except for this one part i want to add to it.The first box i have is called project members which shows the users you can choose to send an email to and the other box is called assignees which is the...
2
4097
by: rka77 | last post by:
Hi, I am trying to make a Python2.6 script on a Win32 that will read all the text files stored in a directory and print only the lines containing actual data. A sample file - Set : 1 Date: 10212009 12 34 56 25 67 90 End Set ******** Set: 2 Date: 10222009
0
8730
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9131
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6669
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5981
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4484
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3189
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 we have to send another system
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.