java窗体线条切换消失_窗体切换特效

FrmClass.cs

View Code1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.Text;4 using System.Windows.Forms;//添加控件及窗体的定名空间

5 using System.Drawing;//添加Point的定名空间

6 using System.Collections;//为ArrayList添加定名空间

7

8 namespaceMagnetismForm9{10 classFrmClass11{12 #region 磁性窗体-公共变量13 //记录窗体的隐蔽与显示

14 public static bool Example_ListShow = false;15 public static bool Example_LibrettoShow = false;16 public static bool Example_ScreenShow = false;17

18 //记录鼠标的当前地位

19 public static Point CPoint; //添加定名空间using System.Drawing;

20 public staticPoint FrmPoint;21 public static int Example_FSpace = 10;//设置窗体间的间隔

22

23 //Frm_Play窗体的地位及大小

24 public static int Example_Play_Top = 0;25 public static int Example_Play_Left = 0;26 public static int Example_Play_Width = 0;27 public static int Example_Play_Height = 0;28 public static bool Example_Assistant_AdhereTo = false;//帮助窗体是否磁性在一路

29

30 //Frm_ListBos窗体的地位及大小

31 public static int Example_List_Top = 0;32 public static int Example_List_Left = 0;33 public static int Example_List_Width = 0;34 public static int Example_List_Height = 0;35 public static bool Example_List_AdhereTo = false;//帮助窗体是否与主窗体磁性在一路

36

37 //Frm_Libretto窗体的地位及大小

38 public static int Example_Libretto_Top = 0;39 public static int Example_Libretto_Left = 0;40 public static int Example_Libretto_Width = 0;41 public static int Example_Libretto_Height = 0;42 public static bool Example_Libretto_AdhereTo = false;//帮助窗体是否与主窗体磁性在一路

43

44 //窗体之间的间隔差

45 public static int Example_List_space_Top = 0;46 public static int Example_List_space_Left = 0;47 public static int Example_Libretto_space_Top = 0;48 public static int Example_Libretto_space_Left = 0;49#endregion50

51#region 检测各窗体是否连接在一路52 ///

53 ///检测各窗体是否连接在一路

54 ///

55 public voidFrmBackCheck()56{57 bool Tem_Magnetism = false;58 //Frm_ListBos与主窗体

59 Tem_Magnetism = false;60 if ((Example_Play_Top - Example_List_Top) == 0)61 Tem_Magnetism = true;62 if ((Example_Play_Left - Example_List_Left) == 0)63 Tem_Magnetism = true;64 if ((Example_Play_Left - Example_List_Left - Example_List_Width) == 0)65 Tem_Magnetism = true;66 if ((Example_Play_Left - Example_List_Left + Example_List_Width) == 0)67 Tem_Magnetism = true;68 if ((Example_Play_Top - Example_List_Top - Example_List_Height) == 0)69 Tem_Magnetism = true;70 if ((Example_Play_Top - Example_List_Top + Example_List_Height) == 0)71 Tem_Magnetism = true;72 if(Tem_Magnetism)73 Example_List_AdhereTo = true;74

75 //Frm_Libretto与主窗体

76 Tem_Magnetism = false;77 if ((Example_Play_Top - Example_Libretto_Top) == 0)78 Tem_Magnetism = true;79 if ((Example_Play_Left - Example_Libretto_Left) == 0)80 Tem_Magnetism = true;81 if ((Example_Play_Left - Example_Libretto_Left - Example_Libretto_Width) == 0)82 Tem_Magnetism = true;83 if ((Example_Play_Left - Example_Libretto_Left + Example_Libretto_Width) == 0)84 Tem_Magnetism = true;85 if ((Example_Play_Top - Example_Libretto_Top - Example_Libretto_Height) == 0)86 Tem_Magnetism = true;87 if ((Example_Play_Top - Example_Libretto_Top + Example_Libretto_Height) == 0)88 Tem_Magnetism = true;89 if(Tem_Magnetism)90 Example_Libretto_AdhereTo = true;91

92 //两个辅窗体

93 Tem_Magnetism = false;94 if ((Example_List_Top - Example_Libretto_Top) == 0)95 Tem_Magnetism = true;96 if ((Example_List_Left - Example_Libretto_Left) == 0)97 Tem_Magnetism = true;98 if ((Example_List_Left - Example_Libretto_Left - Example_Libretto_Width) == 0)99 Tem_Magnetism = true;100 if ((Example_List_Left - Example_Libretto_Left + Example_Libretto_Width) == 0)101 Tem_Magnetism = true;102 if ((Example_List_Top - Example_Libretto_Top - Example_Libretto_Height) == 0)103 Tem_Magnetism = true;104 if ((Example_List_Top - Example_Libretto_Top + Example_Libretto_Height) == 0)105 Tem_Magnetism = true;106 if(Tem_Magnetism)107 Example_Assistant_AdhereTo = true;108}109#endregion110

111#region 哄骗窗体上的控件移动窗体112 ///

113 ///哄骗控件移动窗体

114 ///

115 /// 窗体

116 /// 控件的移动事务

117 public void FrmMove(Form Frm, MouseEventArgs e) //Form或MouseEventArgs添加定名空间using System.Windows.Forms;

118{119 if (e.Button ==MouseButtons.Left)120{121 Point myPosittion = Control.MousePosition;//获取当前鼠标的屏幕坐标

122 myPosittion.Offset(CPoint.X, CPoint.Y);//重载当前鼠标的地位

123 Frm.DesktopLocation = myPosittion;//设置当前窗体在屏幕上的地位

124}125}126#endregion127

128#region 策画窗体之间的间隔差129 ///

130 ///策画窗体之间的间隔差

131 ///

132 /// 窗体

133 /// 跟从窗体

134 public voidFrmDistanceJob(Form Frm, Form Follow)135{136 switch(Follow.Name)137{138 case "Frm_ListBox":139{140 Example_List_space_Top = Follow.Top -Frm.Top;141 Example_List_space_Left = Follow.Left -Frm.Left;142 break;143}144 case "Frm_Libretto":145{146 Example_Libretto_space_Top = Follow.Top -Frm.Top;147 Example_Libretto_space_Left = Follow.Left -Frm.Left;148 break;149}150}151}152#endregion153

154#region 磁性窗体的移动155 ///

156 ///磁性窗体的移动

157 ///

158 /// 窗体

159 /// 控件的移动事务

160 /// 跟从窗体

161 public void ManyFrmMove(Form Frm, MouseEventArgs e, Form Follow) //Form或MouseEventArgs添加定名空间using System.Windows.Forms;

162{163 if (e.Button ==MouseButtons.Left)164{165 int Tem_Left = 0;166 int Tem_Top = 0;167 Point myPosittion = Control.MousePosition;//获取当前鼠标的屏幕坐标

168 switch(Follow.Name)169{170 case "Frm_ListBox":171{172 Tem_Top = Example_List_space_Top -FrmPoint.Y;173 Tem_Left = Example_List_space_Left -FrmPoint.X;174 break;175}176 case "Frm_Libretto":177{178 Tem_Top = Example_Libretto_space_Top -FrmPoint.Y;179 Tem_Left = Example_Libretto_space_Left -FrmPoint.X;180 break;181}182}183myPosittion.Offset(Tem_Left, Tem_Top);184 Follow.DesktopLocation =myPosittion;185}186}187#endregion188

189#region 对窗体的地位进行初始化190 ///

191 ///对窗体的地位进行初始化

192 ///

193 /// 窗体

194 public voidFrmInitialize(Form Frm)195{196 switch(Frm.Name)197{198 case "Frm_Play":199{200 Example_Play_Top =Frm.Top;201 Example_Play_Left =Frm.Left;202 Example_Play_Width =Frm.Width;203 Example_Play_Height =Frm.Height;204 break;205}206 case "Frm_ListBox":207{208 Example_List_Top =Frm.Top;209 Example_List_Left =Frm.Left;210 Example_List_Width =Frm.Width;211 Example_List_Height =Frm.Height;212 break;213}214 case "Frm_Libretto":215{216 Example_Libretto_Top =Frm.Top;217 Example_Libretto_Left =Frm.Left;218 Example_Libretto_Width =Frm.Width;219 Example_Libretto_Height =Frm.Height;220 break;221}222}223

224}225#endregion226

227#region 存储各窗体的当前信息228 ///

229 ///存储各窗体的当前信息

230 ///

231 /// 窗体

232 /// 控件的移动事务

233 public voidFrmPlace(Form Frm)234{235FrmInitialize(Frm);236FrmMagnetism(Frm);237}238#endregion239

240#region 窗体的磁性设置241 ///

242 ///窗体的磁性设置

243 ///

244 /// 窗体

245 public voidFrmMagnetism(Form Frm)246{247 if (Frm.Name != "Frm_Play")248{249 FrmMagnetismCount(Frm, Example_Play_Top, Example_Play_Left, Example_Play_Width, Example_Play_Height, "Frm_Play");250}251 if (Frm.Name != "Frm_ListBos")252{253 FrmMagnetismCount(Frm, Example_List_Top, Example_List_Left, Example_List_Width, Example_List_Height, "Frm_ListBos");254}255 if (Frm.Name != "Frm_Libratto")256{257 FrmMagnetismCount(Frm, Example_Libretto_Top, Example_Libretto_Left, Example_Libretto_Width, Example_Libretto_Height, "Frm_Libratto");258}259FrmInitialize(Frm);260}261#endregion262

263#region 磁性窗体的策画264 ///

265 ///磁性窗体的策画

266 ///

267 /// 窗体

268 /// 控件的移动事务

269 public void FrmMagnetismCount(Form Frm, int top, int left, int width, int height, stringMforms)270{271 bool Tem_Magnetism = false;//断定是否有磁性产生

272 string Tem_MainForm = "";//姑且记录主窗体

273 string Tem_AssistForm = "";//姑且记录辅窗体

274

275 //上方进行磁性窗体

276 if ((Frm.Top + Frm.Height - top) <= Example_FSpace && (Frm.Top + Frm.Height - top) >= -Example_FSpace)277{278 //当一个主窗体不包含辅窗体时

279 if ((Frm.Left >= left && Frm.Left <= (left + width)) || ((Frm.Left + Frm.Width) >= left && (Frm.Left + Frm.Width) <= (left +width)))280{281 Frm.Top = top -Frm.Height;282 if ((Frm.Left - left) <= Example_FSpace && (Frm.Left - left) >= -Example_FSpace)283 Frm.Left =left;284 Tem_Magnetism = true;285}286 //当一个主窗体包含辅窗体时

287 if (Frm.Left <= left && (Frm.Left + Frm.Width) >= (left +width))288{289 Frm.Top = top -Frm.Height;290 if ((Frm.Left - left) <= Example_FSpace && (Frm.Left - left) >= -Example_FSpace)291 Frm.Left =left;292 Tem_Magnetism = true;293}294

295}296

297 //下面进行磁性窗体

298 if ((Frm.Top - (top + height)) <= Example_FSpace && (Frm.Top - (top + height)) >= -Example_FSpace)299{300 //当一个主窗体不包含辅窗体时

301 if ((Frm.Left >= left && Frm.Left <= (left + width)) || ((Frm.Left + Frm.Width) >= left && (Frm.Left + Frm.Width) <= (left +width)))302{303 Frm.Top = top +height;304 if ((Frm.Left - left) <= Example_FSpace && (Frm.Left - left) >= -Example_FSpace)305 Frm.Left =left;306 Tem_Magnetism = true;307}308 //当一个主窗体包含辅窗体时

309 if (Frm.Left <= left && (Frm.Left + Frm.Width) >= (left +width))310{311 Frm.Top = top +height;312 if ((Frm.Left - left) <= Example_FSpace && (Frm.Left - left) >= -Example_FSpace)313 Frm.Left =left;314 Tem_Magnetism = true;315}316}317

318 //左面进行磁性窗体

319 if ((Frm.Left + Frm.Width - left) <= Example_FSpace && (Frm.Left + Frm.Width - left) >= -Example_FSpace)320{321 //当一个主窗体不包含辅窗体时

322 if ((Frm.Top > top && Frm.Top <= (top + height)) || ((Frm.Top + Frm.Height) >= top && (Frm.Top + Frm.Height) <= (top +height)))323{324 Frm.Left = left -Frm.Width;325 if ((Frm.Top - top) <= Example_FSpace && (Frm.Top - top) >= -Example_FSpace)326 Frm.Top =top;327 Tem_Magnetism = true;328}329 //当一个主窗体包含辅窗体时

330 if (Frm.Top <= top && (Frm.Top + Frm.Height) >= (top +height))331{332 Frm.Left = left -Frm.Width;333 if ((Frm.Top - top) <= Example_FSpace && (Frm.Top - top) >= -Example_FSpace)334 Frm.Top =top;335 Tem_Magnetism = true;336}337}338

339 //右面进行磁性窗体

340 if ((Frm.Left - (left + width)) <= Example_FSpace && (Frm.Left - (left + width)) >= -Example_FSpace)341{342 //当一个主窗体不包含辅窗体时

343 if ((Frm.Top > top && Frm.Top <= (top + height)) || ((Frm.Top + Frm.Height) >= top && (Frm.Top + Frm.Height) <= (top +height)))344{345 Frm.Left = left +width;346 if ((Frm.Top - top) <= Example_FSpace && (Frm.Top - top) >= -Example_FSpace)347 Frm.Top =top;348 Tem_Magnetism = true;349}350 //当一个主窗体包含辅窗体时

351 if (Frm.Top <= top && (Frm.Top + Frm.Height) >= (top +height))352{353 Frm.Left = left +width;354 if ((Frm.Top - top) <= Example_FSpace && (Frm.Top - top) >= -Example_FSpace)355 Frm.Top =top;356 Tem_Magnetism = true;357}358}359 if (Frm.Name == "Frm_Play")360 Tem_MainForm = "Frm_Play";361 else

362 Tem_AssistForm =Frm.Name;363 if (Mforms == "Frm_Play")364 Tem_MainForm = "Frm_Play";365 else

366 Tem_AssistForm =Mforms;367 if (Tem_MainForm == "")368{369 Example_Assistant_AdhereTo =Tem_Magnetism;370}371 else

372{373 switch(Tem_AssistForm)374{375 case "Frm_ListBos":376 Example_List_AdhereTo =Tem_Magnetism;377 break;378 case "Frm_Libratto":379 Example_Libretto_AdhereTo =Tem_Magnetism;380 break;381}382}383}384#endregion385

386#region 恢复窗体的初始大小387 ///

388 ///恢复窗体的初始大小(当松开鼠标时,若是窗体的大小小于300*200,恢复初始状况)

389 ///

390 /// 窗体

391 public void FrmScreen_FormerlySize(Form Frm, int PWidth, intPHeight)392{393 if (Frm.Width < PWidth || Frm.Height

398}399}400#endregion401

402}403}

Frm_Play.cs

View Code1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.ComponentModel;4 usingSystem.Data;5 usingSystem.Drawing;6 usingSystem.Linq;7 usingSystem.Text;8 usingSystem.Windows.Forms;9

10 namespaceMagnetismForm11{12 public partial classFrm_Play : Form13{14 publicFrm_Play()15{16InitializeComponent();17}18

19#region 公共变量20 FrmClass Cla_FrmClass = newFrmClass();21 public static Form F_List = newForm();22 public static Form F_Libretto = newForm();23 public static Form F_Screen = newForm();24#endregion25

26 private void Frm_Play_Load(objectsender, EventArgs e)27{28 //窗体地位的初始化

29 Cla_FrmClass.FrmInitialize(this);30}31

32 private void panel_Title_MouseDown(objectsender, MouseEventArgs e)33{34

35 int Tem_Y = 0;36 if (e.Button == MouseButtons.Left)//按下的是否为鼠标左键

37{38 Cla_FrmClass.FrmBackCheck();//检测各窗体是否连在一路

39 Tem_Y =e.Y;40 FrmClass.FrmPoint = new Point(e.X, Tem_Y);//获取鼠标在窗体上的地位,用于磁性窗体

41 FrmClass.CPoint = new Point(-e.X, -Tem_Y);//获取鼠标在屏幕上的地位,用于窗体的移动

42 if (FrmClass.Example_List_AdhereTo)//若是与frm_ListBox窗体相连接

43{44 Cla_FrmClass.FrmDistanceJob(this, F_List);//策画窗体的间隔差

45 if (FrmClass.Example_Assistant_AdhereTo)//两个辅窗体是否连接在一路

46{47 Cla_FrmClass.FrmDistanceJob(this, F_Libretto);//策画窗体的间隔差

48}49}50 if (FrmClass.Example_Libretto_AdhereTo)//若是与frm_Libretto窗体相连接

51{52 Cla_FrmClass.FrmDistanceJob(this, F_Libretto);//策画窗体的间隔差

53 if (FrmClass.Example_Assistant_AdhereTo)//两个辅窗体是否连接在一路

54{55 Cla_FrmClass.FrmDistanceJob(this, F_List);//策画窗体的间隔差

56}57}58}59

60}61

62 private void panel_Title_MouseMove(objectsender, MouseEventArgs e)63{64 if (e.Button == MouseButtons.Left)//按下的是否为鼠标左键

65{66

67 Cla_FrmClass.FrmMove(this, e);//哄骗控件移动窗体

68 if (FrmClass.Example_List_AdhereTo)//若是frm_ListBox窗体与主窗体连接

69{70

71 Cla_FrmClass.ManyFrmMove(this, e, F_List);//磁性窗体的移动

72 Cla_FrmClass.FrmInitialize(F_List);//对frm_ListBox窗体的地位进行初始化

73 if (FrmClass.Example_Assistant_AdhereTo)//若是两个子窗体连接在一路

74{75 Cla_FrmClass.ManyFrmMove(this, e, F_Libretto);76Cla_FrmClass.FrmInitialize(F_Libretto);77}78}79

80 if (FrmClass.Example_Libretto_AdhereTo)//若是frm_Libretto窗体与主窗体连接

81{82 Cla_FrmClass.ManyFrmMove(this, e, F_Libretto);83Cla_FrmClass.FrmInitialize(F_Libretto);84 if(FrmClass.Example_Assistant_AdhereTo)85{86 Cla_FrmClass.ManyFrmMove(this, e, F_List);87Cla_FrmClass.FrmInitialize(F_List);88}89}90 Cla_FrmClass.FrmInitialize(this);91}92}93

94 private void panel_Title_MouseUp(objectsender, MouseEventArgs e)95{96 Cla_FrmClass.FrmPlace(this);97}98

99 private void Frm_Play_Shown(objectsender, EventArgs e)100{101 //显示列表窗体

102 F_List = newFrm_ListBox();103 F_List.ShowInTaskbar = false;104 FrmClass.Example_ListShow = true;105F_List.Show();106 //显示歌词窗体

107 F_Libretto = newFrm_Libretto();108 F_Libretto.ShowInTaskbar = false;109 FrmClass.Example_LibrettoShow = true;110F_Libretto.Show();111 F_Libretto.Left = this.Left + this.Width;112 F_Libretto.Top = this.Top;113 //各窗体地位的初始化

114Cla_FrmClass.FrmInitialize(F_List);115Cla_FrmClass.FrmInitialize(F_Libretto);116}117

118 private void panel_Close_Click(objectsender, EventArgs e)119{120F_List.Close();121F_List.Dispose();122F_Libretto.Close();123F_Libretto.Dispose();124F_Screen.Close();125F_Screen.Dispose();126 this.Close();127}128

129 private void panel_Title_Click(objectsender, EventArgs e)130{131F_List.Focus();132F_Libretto.Focus();133 this.Focus();134

135}136

137}138}

Frm_Play.designer.cs

View Code1 namespaceMagnetismForm2{3 partial classFrm_Play4{5 ///

6 ///必须的设计器变量。

7 ///

8 private System.ComponentModel.IContainer components = null;9

10 ///

11 ///清理所有正在应用的资料。

12 ///

13 /// 若是应开释托管资料,为 true;不然为 false。

14 protected override void Dispose(booldisposing)15{16 if (disposing && (components != null))17{18components.Dispose();19}20 base.Dispose(disposing);21}22

23#region Windows 窗体设计器生成的代码24

25 ///

26 ///设计器支撑所需的办法 - 不要

27 ///应用代码编辑器批改此办法的内容。

28 ///

29 private voidInitializeComponent()30{31 this.panel_Title = newSystem.Windows.Forms.Panel();32 this.panel_Close = newSystem.Windows.Forms.Panel();33 this.pictureBox1 = newSystem.Windows.Forms.PictureBox();34 this.panel_Title.SuspendLayout();35 ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();36 this.SuspendLayout();37 //38 //panel_Title

39 //40 this.panel_Title.BackColor =System.Drawing.Color.MediumBlue;41 this.panel_Title.BackgroundImage = global::MagnetismForm.Properties.Resources._1;42 this.panel_Title.Controls.Add(this.panel_Close);43 this.panel_Title.Dock =System.Windows.Forms.DockStyle.Top;44 this.panel_Title.Location = new System.Drawing.Point(0, 0);45 this.panel_Title.Name = "panel_Title";46 this.panel_Title.Size = new System.Drawing.Size(290, 31);47 this.panel_Title.TabIndex = 0;48 this.panel_Title.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel_Title_MouseMove);49 this.panel_Title.Click += new System.EventHandler(this.panel_Title_Click);50 this.panel_Title.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel_Title_MouseDown);51 this.panel_Title.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel_Title_MouseUp);52 //53 //panel_Close

54 //55 this.panel_Close.BackColor =System.Drawing.Color.Red;56 this.panel_Close.BackgroundImage = global::MagnetismForm.Properties.Resources.Close;57 this.panel_Close.Location = new System.Drawing.Point(270, 5);58 this.panel_Close.Name = "panel_Close";59 this.panel_Close.Size = new System.Drawing.Size(18, 18);60 this.panel_Close.TabIndex = 0;61 this.panel_Close.Click += new System.EventHandler(this.panel_Close_Click);62 //63 //pictureBox1

64 //65 this.pictureBox1.Image = global::MagnetismForm.Properties.Resources._4;66 this.pictureBox1.Location = new System.Drawing.Point(0, 31);67 this.pictureBox1.Name = "pictureBox1";68 this.pictureBox1.Size = new System.Drawing.Size(290, 89);69 this.pictureBox1.SizeMode =System.Windows.Forms.PictureBoxSizeMode.StretchImage;70 this.pictureBox1.TabIndex = 1;71 this.pictureBox1.TabStop = false;72 //73 //Frm_Play

74 //75 this.AutoScaleDimensions = newSystem.Drawing.SizeF(6F, 12F);76 this.AutoScaleMode =System.Windows.Forms.AutoScaleMode.Font;77 this.ClientSize = new System.Drawing.Size(290, 120);78 this.Controls.Add(this.pictureBox1);79 this.Controls.Add(this.panel_Title);80 this.FormBorderStyle =System.Windows.Forms.FormBorderStyle.None;81 this.Name = "Frm_Play";82 this.Text = "主窗体";83 this.Load += new System.EventHandler(this.Frm_Play_Load);84 this.Shown += new System.EventHandler(this.Frm_Play_Shown);85 this.panel_Title.ResumeLayout(false);86 ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();87 this.ResumeLayout(false);88

89}90

91#endregion92

93 privateSystem.Windows.Forms.Panel panel_Title;94 privateSystem.Windows.Forms.Panel panel_Close;95 privateSystem.Windows.Forms.PictureBox pictureBox1;96}97}

Frm_ListBox.cs

View Code1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.ComponentModel;4 usingSystem.Data;5 usingSystem.Drawing;6 usingSystem.Linq;7 usingSystem.Text;8 usingSystem.Windows.Forms;9

10 namespaceMagnetismForm11{12 public partial classFrm_ListBox : Form13{14 publicFrm_ListBox()15{16InitializeComponent();17}18

19#region 公共变量20 FrmClass Cla_FrmClass = newFrmClass();21#endregion22

23 private void Frm_ListBox_Load(objectsender, EventArgs e)24{25 this.Left =FrmClass.Example_Play_Left;26 this.Top = FrmClass.Example_Play_Top +FrmClass.Example_Play_Height;27 Cla_FrmClass.FrmInitialize(this);28}29

30 private void panel_Title_MouseDown(objectsender, MouseEventArgs e)31{32 FrmClass.CPoint = new Point(-e.X, -e.Y);33}34

35 private void panel_Title_MouseMove(objectsender, MouseEventArgs e)36{37 FrmClass.Example_Assistant_AdhereTo = false;38 FrmClass.Example_List_AdhereTo = false;39 Cla_FrmClass.FrmMove(this, e);40}41

42 private void panel_Title_MouseUp(objectsender, MouseEventArgs e)43{44 Cla_FrmClass.FrmPlace(this);45}46}47}

Frm_ListBox.designer.cs

View Code1 namespaceMagnetismForm2{3 partial classFrm_ListBox4{5 ///

6 ///Required designer variable.

7 ///

8 private System.ComponentModel.IContainer components = null;9

10 ///

11 ///Clean up any resources being used.

12 ///

13 /// true if managed resources should be disposed; otherwise, false.

14 protected override void Dispose(booldisposing)15{16 if (disposing && (components != null))17{18components.Dispose();19}20 base.Dispose(disposing);21}22

23#region Windows Form Designer generated code24

25 ///

26 ///Required method for Designer support - do not modify

27 ///the contents of this method with the code editor.

28 ///

29 private voidInitializeComponent()30{31 this.pictureBox1 = newSystem.Windows.Forms.PictureBox();32 this.panel_Title = newSystem.Windows.Forms.Panel();33 ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();34 this.SuspendLayout();35 //36 //pictureBox1

37 //38 this.pictureBox1.Image = global::MagnetismForm.Properties.Resources._4;39 this.pictureBox1.Location = new System.Drawing.Point(0, 31);40 this.pictureBox1.Name = "pictureBox1";41 this.pictureBox1.Size = new System.Drawing.Size(290, 89);42 this.pictureBox1.TabIndex = 1;43 this.pictureBox1.TabStop = false;44 //45 //panel_Title

46 //47 this.panel_Title.BackColor =System.Drawing.Color.MediumBlue;48 this.panel_Title.BackgroundImage = global::MagnetismForm.Properties.Resources._5;49 this.panel_Title.Dock =System.Windows.Forms.DockStyle.Top;50 this.panel_Title.Location = new System.Drawing.Point(0, 0);51 this.panel_Title.Name = "panel_Title";52 this.panel_Title.Size = new System.Drawing.Size(290, 31);53 this.panel_Title.TabIndex = 0;54 this.panel_Title.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel_Title_MouseMove);55 this.panel_Title.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel_Title_MouseDown);56 this.panel_Title.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel_Title_MouseUp);57 //58 //Frm_ListBox

59 //60 this.AutoScaleDimensions = newSystem.Drawing.SizeF(6F, 12F);61 this.AutoScaleMode =System.Windows.Forms.AutoScaleMode.Font;62 this.ClientSize = new System.Drawing.Size(290, 120);63 this.Controls.Add(this.pictureBox1);64 this.Controls.Add(this.panel_Title);65 this.FormBorderStyle =System.Windows.Forms.FormBorderStyle.None;66 this.Name = "Frm_ListBox";67 this.Text = "辅窗体1";68 this.Load += new System.EventHandler(this.Frm_ListBox_Load);69 ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();70 this.ResumeLayout(false);71

72}73

74#endregion75

76 privateSystem.Windows.Forms.Panel panel_Title;77 privateSystem.Windows.Forms.PictureBox pictureBox1;78}79}

Frm_Libretto.cs

View Code1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.ComponentModel;4 usingSystem.Data;5 usingSystem.Drawing;6 usingSystem.Linq;7 usingSystem.Text;8 usingSystem.Windows.Forms;9

10 namespaceMagnetismForm11{12 public partial classFrm_Libretto : Form13{14 publicFrm_Libretto()15{16InitializeComponent();17}18

19#region 公共变量20 FrmClass Cla_FrmClass = newFrmClass();21#endregion22

23 private void Frm_Libretto_Load(objectsender, EventArgs e)24{25 this.Top =FrmClass.Example_Play_Top;26 this.Left = FrmClass.Example_Play_Left +FrmClass.Example_Play_Width;27 Cla_FrmClass.FrmInitialize(this);28}29

30 private void panel_Title_MouseDown(objectsender, MouseEventArgs e)31{32 FrmClass.CPoint = new Point(-e.X, -e.Y);33}34

35 private void panel_Title_MouseMove(objectsender, MouseEventArgs e)36{37 FrmClass.Example_Assistant_AdhereTo = false;38 FrmClass.Example_Libretto_AdhereTo = false;39 Cla_FrmClass.FrmMove(this, e);40}41

42 private void panel_Title_MouseUp(objectsender, MouseEventArgs e)43{44 Cla_FrmClass.FrmPlace(this);45}46}47}

Frm_Libretto.designer.cs

View Code1 namespaceMagnetismForm2{3 partial classFrm_Libretto4{5 ///

6 ///Required designer variable.

7 ///

8 private System.ComponentModel.IContainer components = null;9

10 ///

11 ///Clean up any resources being used.

12 ///

13 /// true if managed resources should be disposed; otherwise, false.

14 protected override void Dispose(booldisposing)15{16 if (disposing && (components != null))17{18components.Dispose();19}20 base.Dispose(disposing);21}22

23#region Windows Form Designer generated code24

25 ///

26 ///Required method for Designer support - do not modify

27 ///the contents of this method with the code editor.

28 ///

29 private voidInitializeComponent()30{31 this.pictureBox1 = newSystem.Windows.Forms.PictureBox();32 this.panel_Title = newSystem.Windows.Forms.Panel();33 ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();34 this.SuspendLayout();35 //36 //pictureBox1

37 //38 this.pictureBox1.Image = global::MagnetismForm.Properties.Resources._2;39 this.pictureBox1.Location = new System.Drawing.Point(0, 31);40 this.pictureBox1.Name = "pictureBox1";41 this.pictureBox1.Size = new System.Drawing.Size(290, 209);42 this.pictureBox1.TabIndex = 1;43 this.pictureBox1.TabStop = false;44 //45 //panel_Title

46 //47 this.panel_Title.BackColor =System.Drawing.Color.MediumBlue;48 this.panel_Title.BackgroundImage = global::MagnetismForm.Properties.Resources._5;49 this.panel_Title.Dock =System.Windows.Forms.DockStyle.Top;50 this.panel_Title.Location = new System.Drawing.Point(0, 0);51 this.panel_Title.Name = "panel_Title";52 this.panel_Title.Size = new System.Drawing.Size(290, 31);53 this.panel_Title.TabIndex = 0;54 this.panel_Title.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel_Title_MouseMove);55 this.panel_Title.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel_Title_MouseDown);56 this.panel_Title.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel_Title_MouseUp);57 //58 //Frm_Libretto

59 //60 this.AutoScaleDimensions = newSystem.Drawing.SizeF(6F, 12F);61 this.AutoScaleMode =System.Windows.Forms.AutoScaleMode.Font;62 this.ClientSize = new System.Drawing.Size(290, 240);63 this.Controls.Add(this.pictureBox1);64 this.Controls.Add(this.panel_Title);65 this.FormBorderStyle =System.Windows.Forms.FormBorderStyle.None;66 this.Name = "Frm_Libretto";67 this.Text = "Frm_Libretto";68 this.Load += new System.EventHandler(this.Frm_Libretto_Load);69 ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();70 this.ResumeLayout(false);71

72}73

74#endregion75

76 privateSystem.Windows.Forms.Panel panel_Title;77 privateSystem.Windows.Forms.PictureBox pictureBox1;78}79}

1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看REAdMe.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看REAdMe.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看READme.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值