.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

change label size dynamically

Posted By: Madhu Gowda     Posted Date: April 19, 2011    Points:5   Category :ASP.Net
i have label control..that label size (height and width) should be change based on data which will retrieve from database.....
so how to do dis dynamically..
thnx in advance...

Responses
Author: Kannan C S             
Posted Date: April 19, 2011     Points: 20   

Hi,

try this lblTitle.width=20px;

Author: Mahesh             
Posted Date: April 19, 2011     Points: 20   

hi,
pls use the font and its name used in u r application,

Dim myFont As New Font("Courier New", 8)
Dim myFontBold As New Font("Microsoft Sans Serif", 10, FontStyle.Bold)
Dim StringSize As New SizeF

StringSize = e.Graphics.MeasureString("How wide is this string?", myFont)
Label1.Height = StringSize.Height
Label1.Width = StringSize.Width

Thanks
Mahesh



Author: kamlesh             
Posted Date: April 26, 2011     Points: 20   

check Below Links...


http://stackoverflow.com/questions/2454572/how-to-change-label-size-dynamically-using-numericupdown-in-c
http://stackoverflow.com/questions/1946371/is-it-possible-to-dynamically-resize-the-lable-in-c-without-changing-the-length
http://stackoverflow.com/questions/1255982/dynamically-change-size-of-splitcontainer-panel
http://stackoverflow.com/questions/889906/label-size-changes
http://www.csharp411.com/change-font-size/

Thanks And Regards.
Kamlesh Nikam


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend