I would like to show how we can display a longer text with line breaks, actually the string is as follows
Anna’s crusade gets a Gen Singh boost
29 Indian fishermen still languish in Iran prison
Shiromani Akali Dal sarpanch held for slapping Sanaur
superintendent of panchayat department
Jats to review Delhi march schedule
Doctor in the eye of the storm
the exact way I would like to print my text on the label, so I write as follows
using (StringReader reader = new StringReader(mymessage)) // here mymessage is your variable
{
string line;
labelmsg.Text = string.Empty;
while ((line = reader.ReadLine()) != null)
{
line.Trim();
labelmsg.Text += line + "
";
}
}
here come the label text as follows
If any other easier method or queries let me know.
Subscribe to:
Post Comments (Atom)
Popular Posts
-
In this blog I am going to show how we can work with cascading dropdown list for country/state/city in asp.net using Entity Framework. ...
-
In this post I would like to share some thing regarding Entity Framework, how we can implement CRUD operations using stored procedures in E...
-
Create a table in SQL server as follows USE [forumDB1] GO /****** Object: Table [dbo].[users] Script Date: 01/23/2013 11:25:...
-
I have attended an interview, there I asked a question like how to create a Tab container in asp.net dynamically with the department name fr...
-
In this article I will explain how we can work with Dynamic Data Entities Web Application which is available at the time of creating a p...
-
Hi all in this blog I would like to show you how we can create a forums application using MVC4 along with entity framework. Database ...
-
Adding composite primary key in MySQL ALTER TABLE tablename DROP PRIMARY KEY, ADD PRIMARY KEY ( columnID1 , columnID2 , columnID3...
-
In this post I am going to explain how we can validate two DateEdit controls which are Devexpress controls using CustomValidator. First d...
-
Have you ever come across the warning System.Configuration.ConfigurationSettings.AppSettings' is obsolete: '"This method is o...
-
In the last blog I posted how can directly call Stored Procedures with out mapping them to a Model. Check here Entity Framework Download...
No comments:
Post a Comment