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

Open default email app in .NET MAUI

Sample Code:  if (Email.Default.IsComposeSupported) {     string subject = "Hello!";     string body = "Excellent!";    ...