does anybody know a way how to create a Label(WindowsForms) with two different Fonts or at least two different FontSizes?
Asked
Active
Viewed 6,181 times
3
-
possible duplicate: http://stackoverflow.com/questions/11311/formatting-text-in-winform-label – bla Sep 09 '11 at 08:00
-
@Lee Sy En: your right, thanks for showing. Is the rigth behaiviour in this forum to delete my question know?? – mono Sep 09 '11 at 08:09
4 Answers
2
Try to override
or handle paint
event (method) use classes from System.Drawing
namespace.

KV Prajapati
- 93,659
- 19
- 148
- 186
2
You have to create your own drawing using GDI also try to find out if you can find any other third party controls that support your need !! Hopefully you might get them.

Shashi
- 71
- 3
-1
you can do that things with usercontrol wpf first of all from add item search usercontrol and after that in the xml of builder name grid like t1 and in the code of it type this code
StringBuilder sb = new StringBuilder();
sb.Append(@"<TextBlock xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'> ");
sb.Append(@" Hello <Bold>my</Bold> faithful <Underline>computer</Underline>.<Italic>You rock!</Italic>");
sb.Append(@"</TextBlock> ");
TextBlock myButton = (TextBlock)XamlReader.Parse(sb.ToString());
t1.Children.Add(myButton);
and run it and change it in a new manner.