コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 private void SetButton(DartButton button, string text)
 {
     button.Text    = text;
     button.Visible = true;
     ScaleText(button, 0.9f);
 }