예제 #1
0
 public SoundButtonMaker(int x, int y, int height, int width, string name)
 {
     Name          = name;
     Data          = new SoundButtonData();
     SoundForm     = new SelectSound(UpdateBtnText, Data);
     Btn           = new Button();
     Btn.Click    += Btn_Click;
     Btn.Size      = new Size(width * Scale, height * Scale);
     Btn.Location  = new Point(Origin.X + x * Scale, Origin.Y + y * Scale);
     Btn.Text      = name;
     Btn.TextAlign = ContentAlignment.TopCenter;
     Parent.Controls.Add(Btn);
     Parent.KeyPress += Form_KeyPress;
 }
예제 #2
0
 virtual protected void Btn_Click(object sender, EventArgs e)
 {
     if (SoundForm == null)
     {
         SoundForm = new SelectSound(UpdateBtnText, Data);
     }
     try
     {
         SoundForm.LoadFromData();
         SoundForm.Show();
     }
     catch (ObjectDisposedException)
     {
         SoundForm = new SelectSound(UpdateBtnText, Data);
         SoundForm.Show();
     }
     Form1.SetFocus();
 }
예제 #3
0
 public void Update()
 {
     SoundForm = new SelectSound(UpdateBtnText, Data);
     Btn.Text  = Name + "\n" + Data.Name;
 }