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

If you’re using Visual Studio to build your .NET MAUI app on a Mac, locating the IPA (iOS App Package) file can be a bit tricky

  If you’re using   Visual Studio   to build your   .NET MAUI   app on a   Mac , locating the   IPA (iOS App Package)   file can be a bit tr...