473,385 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Maintain formatting

I want to fill a textbox or a label or with lines from a listbox. I want to
preserve the lline for line as it comes from the list box. I do not want the
test to run-on. I suppose it is okay to wrap if it is longer than the width
of the control.

This data will later be taken from this control and put into a text box in a
report in ReportViewer where I will want to preserve the same formating
there.

Thank you,
Doug
Jun 27 '08 #1
1 1493
Hi Doug,

From your description, you want to display items from a ListBox in a
TextBox/Label and still make each item's Text display in separate line,
correct?

I think for this question, the method will be different depend on the
container element which will display the items. For example, if you want to
display the items in label control, you need to append an html line break
<br/element at the end of each item. However, if you use Textbox, since
it display plain text, you need to append a plain text line break '\n' at
the end. e.g.

====================
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = "";
foreach (ListItem item in ListBox1.Items)
{
Label1.Text += item.Text + "<br/>";
}
}
====================

Also, if you want to move the text later to the reporting service report or
any other display UI, you also need to take care of such difference on line
break.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "dbuchanan" <db*******@newsgroup.nospam>
Subject: Maintain formatting
Date: Thu, 26 Jun 2008 01:44:55 -0400
>
I want to fill a textbox or a label or with lines from a listbox. I want
to
>preserve the lline for line as it comes from the list box. I do not want
the
>test to run-on. I suppose it is okay to wrap if it is longer than the
width
>of the control.

This data will later be taken from this control and put into a text box in
a
>report in ReportViewer where I will want to preserve the same formating
there.

Thank you,
Doug
Jun 27 '08 #2

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

Similar topics

3
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be...
2
by: Colleyville Alan | last post by:
I am using Access and have embedded the ActiveX control Formula One that came with Office 2000. (ver 3.04). I have created and formatted a spreadsheet and now I want to copy the info with...
4
by: DBQueen | last post by:
I have a subform which is in Continuous Forms view. I have added a button to the bottom of the page to move to the next record using the button wizard (result: DoCmd.GoToRecord , , acNext). I...
4
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the...
1
by: Julie | last post by:
I have the need to preserve the precision of a user-entered number, but that needs to be stored in a (non-string) floating point variable (such as double or decimal). Due to the internal...
5
by: John Smith | last post by:
Here is my HTML table formatting code. <table border="1" width="100%"> <tr width = "100%"> <td width="33%">11asdhagdshaskgashjgahjgadhjgdjshdgasjdgajdgadjhgdgahjdgadhjsgad
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
8
by: Typehigh | last post by:
I have many text fields with conditional formatting applied, specifically when the condition is "Field Has Focus". Without any events associated with the fields the conditional formatting works...
11
by: Joseph Geretz | last post by:
I've been looking at two approaches for the maintenance of Session state for a Web Service application. One approach uses the old familiar Session object which I've used in the past for Web...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.