For VS2010 C#:
Please I'm in need of custom formatting of the button 'text' property in my aspx page.
The code below creates a string for the BUTTON TEXT that displays a calculated total figure, then a new line and then the words "Events Completed". This works.
I need to format the string so that the TOTAL figure is a LARGER font (14px), BOLD, and with a comma.
Then the text "Events Completed" formatted to smaller font (10px).
Both will be font: Segoi UI.
I've tried String formats with no success. thank you for any help.
However the code doesn't address the 1st line is 14px but the 2nd line is 10px. so there's 2 different font sizes for the button text.Can this be done?
68camaro
Member
9 Points
7 Posts
Custom Format Button Text. ASP C#
Nov 12, 2012 10:11 PM|LINK
For VS2010 C#:
Please I'm in need of custom formatting of the button 'text' property in my aspx page.
The code below creates a string for the BUTTON TEXT that displays a calculated total figure, then a new line and then the words "Events Completed". This works.
I've tried String formats with no success. thank you for any help.
btnEventsCompleted.Text = GetTotal("Home", "1").ToString() + "\r\n" + " Events Completed";
oned_gk
All-Star
31671 Points
6473 Posts
Re: Custom Format Button Text. ASP C#
Nov 12, 2012 11:24 PM|LINK
btnEventsCompleted.Font.Bold = true; btnEventsCompleted.Font.Size = new FontUnit("14px"); btnEventsCompleted.Font.Name= "Segoe UI";68camaro
Member
9 Points
7 Posts
Re: Custom Format Button Text. ASP C#
Nov 13, 2012 01:22 AM|LINK
thank you for this.
However the code doesn't address the 1st line is 14px but the 2nd line is 10px. so there's 2 different font sizes for the button text.Can this be done?
thanks again.
Amy Peng - M...
Star
10198 Points
964 Posts
Microsoft
Re: Custom Format Button Text. ASP C#
Nov 16, 2012 02:25 AM|LINK
Hi 68camaro,
Please try to refer to the following code in HTML:
<style> .ok { color: yellow; font-size: 14px; } .done { color: red; font-size: 10px; } </style> <button><span class="ok">Ok</span><br><span class="done">Events Completed</span></button>Regards,
Amy Peng
Feedback to us
Develop and promote your apps in Windows Store
gaurabchatte...
Participant
1663 Points
329 Posts
Re: Custom Format Button Text. ASP C#
Nov 16, 2012 03:38 AM|LINK
Dear i think you cant do that in two formatting in one button .
But you can seperate the two lines in button .
read the answered post in the forum
http://forums.asp.net/t/1161890.aspx/1
Microsoft Technologies