code_junkie

C#: What is the proper way to change the font style (underline) from a Label at runtime?

Nov 12th, 2011
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. lblName.Font = new Font(... etc. etc.
  2.  
  3. this.Font = new Font(this.Font, FontStyle.Underline);
  4.  
  5. //
  6. // Summary:
  7. // Gets or sets a value that indicates whether the font is underlined.
  8. //
  9. // Returns:
  10. // true if the font is underlined; otherwise, false. The default value is false.
  11. [DefaultValue(false)]
  12. [NotifyParentProperty(true)]
  13. public bool Underline { get; set; }
Add Comment
Please, Sign In to add comment