private Point _Position;//拖动窗体 public FormSelectTeacherTop(FormSelectTeacher f, int type) { fParent = f; SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); UpdateStyles(); InitializeComponent(); _Position = new Point(); if (type == 1) { InitForm(); } else { InitForm_LessonOver(); } this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter; this.label2.Top = 30; this.pictureBox1.BackColor = Color.White; this.pictureBox1.BringToFront();//将背景图片放到最下面 //this.panel1.BackColor = Color.Transparent;//将Panel设为透明 //this.panel1.Parent = this.picturebox1;//将panel父控件设为背景图片控件 //this.panel1.BringToFront();//将panel放在前面 }
private void HideForm(object sender, EventArgs e) { this.WindowState = FormWindowState.Minimized; fParent.Dispose(); fParent = null; this.Dispose(); this.Close(); }
//确定下课 private void pictureBox_lessonover_btn_Click(object sender, EventArgs e) { //TODO: 下课事件处理 Form1.ShowController(false); this.WindowState = FormWindowState.Minimized; fParent.Dispose(); fParent = null; this.Dispose(); this.Close(); }
private Point _Position;//拖动窗体 public FormSelectTeacher_Login(FormSelectTeacher f, int type) { fParent = f; SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); UpdateStyles(); InitializeComponent(); _Position = new Point(); if (type == 1) { //InitForm(); } else { //InitForm_LessonOver(); } }