Monday, July 11, 2011

WPF-how to set label font to Bold from CodeBehind

Label tb = new Label();
tb.Name = "LabelID" + iRow;
tb.Content = lblName;

Grid.SetColumn(tb, iCol);

Grid.SetRow(tb, iRow);
Grid.SetColumnSpan(tb, 2);
tb.Foreground = Brushes.DarkGreen;

tb.Height = 50;

tb.FontSize = 18;

tb.FontWeight = FontWeights.Bold;


gChildGrid.Children.Add(tb);

No comments:

Post a Comment

LIveCharts2: Charts for Windows and web

Charts for Windows and web including .Net MAUI  LiveCharts - LiveCharts2 (lvcharts.com)