public override void Activate() { base.Activate(); foreach (var filename in Questions.GetGames()) { var control = new DartButton { Width = flowLayoutPanel.ClientSize.Width, Height = flowLayoutPanel.ClientSize.Height / 8, Text = Path.GetFileNameWithoutExtension(filename), Tag = filename, }; control.Click += ButtonClicked; ScaleText(control); flowLayoutPanel.Controls.Add(control); } }
public override void Activate() { base.Activate(); flowLayoutPanel.Controls.Clear(); foreach (var culture in SupportedCultures.Select(n => CultureInfo.GetCultureInfo(n))) { var control = new DartButton { Width = flowLayoutPanel.ClientSize.Width / count - 2 * margin, Height = flowLayoutPanel.ClientSize.Height / 10, Text = culture.NativeName, Tag = culture, Margin = new Padding(margin) }; control.Click += CultureButtonClicked; ScaleText(control); flowLayoutPanel.Controls.Add(control); } }
private void SetButton(DartButton button, string text) { button.Text = text; button.Visible = true; ScaleText(button, 0.9f); }