📄 form1.cs
字号:
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
//using System.Reflection;
namespace WinApp
{
using System.Drawing;
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : Form
{
private Image img;
private bool slatOut=false;
private System.ComponentModel.IContainer components;
private Timer time1 = new Timer();
private Rectangle rect = new Rectangle(100,100,130,70);
private System.Windows.Forms.PictureBox Playing;
private System.Windows.Forms.PictureBox Circle;
private System.Windows.Forms.PictureBox CDAudio;
private System.Windows.Forms.PictureBox smBut;
private System.Windows.Forms.PictureBox stopBut;
Point pt = new Point(200,100);
private bool blnMoving = false;
private int MouseDownX;
private System.Windows.Forms.Label disp;
private System.Windows.Forms.Button Ex;
private int MouseDownY;
private bool playFlg=false;
private ArrayList imgList = new ArrayList();
private System.Windows.Forms.Label tm;
private System.Windows.Forms.PictureBox animatPicture;
private int cnt = -1;
public Form1()
{
time1.Interval = 100;
time1.Enabled = true;
time1.Tick += new EventHandler(time1_Tick);
img = new Bitmap("mediaPlayer.jpg");
//
// Required for Windows Form Designer support
//
InitializeComponent();
this.CDAudio.Image = System.Drawing.Bitmap.FromFile("CDAudio.jpg");
this.Playing.Image = System.Drawing.Bitmap.FromFile("PlayingUp.jpg");
this.Circle.Image = System.Drawing.Bitmap.FromFile("Circle.jpg");
this.smBut.Image = System.Drawing.Bitmap.FromFile("buttonNormal.jpg");
this.stopBut.Image = System.Drawing.Bitmap.FromFile("stopButNormal.jpg");
Application.ApplicationExit += new EventHandler(Form_OnExit);
// Application.AddMessageFilter(msgFilter);
}
private void ToolBar_Clicked(object sender, ToolBarButtonClickEventArgs e)
{
MessageBox.Show(e.Button.ToolTipText);
}
private void HelpAbout_Clicked(object sender, EventArgs e)
{
MessageBox.Show("The amazing menu app ...");
}
private void FileExit_Clicked(object sender, EventArgs e)
{
this.Close();
}
private void Form_OnExit(object sender, EventArgs evArgs)
{
}
private void GetStats()
{
MessageBox.Show(Application.StartupPath, "I live here...");
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.smBut = new System.Windows.Forms.PictureBox();
this.CDAudio = new System.Windows.Forms.PictureBox();
this.disp = new System.Windows.Forms.Label();
this.Ex = new System.Windows.Forms.Button();
this.Playing = new System.Windows.Forms.PictureBox();
this.Circle = new System.Windows.Forms.PictureBox();
this.animatPicture = new System.Windows.Forms.PictureBox();
this.stopBut = new System.Windows.Forms.PictureBox();
this.tm = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// smBut
//
this.smBut.Location = new System.Drawing.Point(473, 100);
this.smBut.Name = "smBut";
this.smBut.Size = new System.Drawing.Size(17, 33);
this.smBut.TabIndex = 6;
this.smBut.TabStop = false;
this.smBut.Click += new System.EventHandler(this.smBut_Click);
this.smBut.MouseEnter += new System.EventHandler(this.smBut_MouseEnter);
this.smBut.MouseLeave += new System.EventHandler(this.smBut_MouseLeave);
//
// CDAudio
//
this.CDAudio.Location = new System.Drawing.Point(4, 108);
this.CDAudio.Name = "CDAudio";
this.CDAudio.Size = new System.Drawing.Size(88, 40);
this.CDAudio.TabIndex = 4;
this.CDAudio.TabStop = false;
this.CDAudio.Click += new System.EventHandler(this.pictureBox1_Click);
this.CDAudio.MouseEnter += new System.EventHandler(this.CDAudio_MouseEnter);
this.CDAudio.MouseLeave += new System.EventHandler(this.CDAudio_MouseLeave);
//
// disp
//
this.disp.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.disp.BackColor = System.Drawing.Color.Black;
this.disp.ForeColor = System.Drawing.Color.Lime;
this.disp.Location = new System.Drawing.Point(204, 196);
this.disp.Name = "disp";
this.disp.Size = new System.Drawing.Size(156, 18);
this.disp.TabIndex = 8;
//
// Ex
//
this.Ex.BackColor = System.Drawing.Color.LightGray;
this.Ex.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.Ex.ForeColor = System.Drawing.Color.Black;
this.Ex.Location = new System.Drawing.Point(440, 8);
this.Ex.Name = "Ex";
this.Ex.Size = new System.Drawing.Size(14, 14);
this.Ex.TabIndex = 5;
this.Ex.Text = "X";
this.Ex.Click += new System.EventHandler(this.button1_Click_1);
this.Ex.MouseEnter += new System.EventHandler(this.Ex_MouseEnter);
this.Ex.MouseLeave += new System.EventHandler(this.Ex_MouseLeave);
//
// Playing
//
this.Playing.Location = new System.Drawing.Point(4, 68);
this.Playing.Name = "Playing";
this.Playing.Size = new System.Drawing.Size(88, 40);
this.Playing.TabIndex = 2;
this.Playing.TabStop = false;
this.Playing.Click += new System.EventHandler(this.Playing_Click);
this.Playing.MouseEnter += new System.EventHandler(this.Playing_MouseEnter);
this.Playing.MouseLeave += new System.EventHandler(this.Playing_MouseLeave);
//
// Circle
//
this.Circle.Location = new System.Drawing.Point(109, 200);
this.Circle.Name = "Circle";
this.Circle.Size = new System.Drawing.Size(68, 68);
this.Circle.TabIndex = 3;
this.Circle.TabStop = false;
this.Circle.Click += new System.EventHandler(this.Circle_Click);
this.Circle.MouseEnter += new System.EventHandler(this.Circle_MouseEnter);
this.Circle.MouseLeave += new System.EventHandler(this.Circle_MouseLeave);
//
// animatPicture
//
this.animatPicture.BackColor = System.Drawing.Color.Black;
this.animatPicture.Location = new System.Drawing.Point(128, 40);
this.animatPicture.Name = "animatPicture";
this.animatPicture.Size = new System.Drawing.Size(280, 136);
this.animatPicture.TabIndex = 10;
this.animatPicture.TabStop = false;
this.animatPicture.Tag = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right);
//
// stopBut
//
this.stopBut.Location = new System.Drawing.Point(180, 220);
this.stopBut.Name = "stopBut";
this.stopBut.Size = new System.Drawing.Size(36, 49);
this.stopBut.TabIndex = 7;
this.stopBut.TabStop = false;
this.stopBut.Click += new System.EventHandler(this.stopBut_Click);
this.stopBut.MouseEnter += new System.EventHandler(this.stopBut_MouseEnter);
this.stopBut.MouseLeave += new System.EventHandler(this.stopBut_MouseLeave);
//
// tm
//
this.tm.BackColor = System.Drawing.Color.Black;
this.tm.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(255)), ((System.Byte)(128)));
this.tm.Location = new System.Drawing.Point(352, 196);
this.tm.Name = "tm";
this.tm.Size = new System.Drawing.Size(72, 18);
this.tm.TabIndex = 9;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.BackColor = System.Drawing.Color.Silver;
this.ClientSize = new System.Drawing.Size(658, 605);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.animatPicture,
this.tm,
this.disp,
this.stopBut,
this.smBut,
this.Ex,
this.CDAudio,
this.Circle,
this.Playing});
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.TransparencyKey = System.Drawing.Color.Silver;
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseUp);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form_Paint);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -