































































































































































































































































































using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace QQ
{
/// <summary>
/// Form2 的摘要说明。
/// </summary>
public class Form2 : System.Windows.Forms.Form
{
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.PictureBox pictureBox3;
private System.Windows.Forms.PictureBox pictureBox4;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form2()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form2));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.pictureBox3 = new System.Windows.Forms.PictureBox();
this.pictureBox4 = new System.Windows.Forms.PictureBox();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
this.pictureBox1.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox1.Location = new System.Drawing.Point(304, 5);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(21, 21);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
this.pictureBox1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseUp);
this.pictureBox1.MouseLeave += new System.EventHandler(this.pictureBox1_MouseLeave);
this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown);
//
// pictureBox2
//
this.pictureBox2.BackColor = System.Drawing.Color.Transparent;
this.pictureBox2.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox2.Location = new System.Drawing.Point(258, 5);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(21, 21);
this.pictureBox2.TabIndex = 1;
this.pictureBox2.TabStop = false;
this.pictureBox2.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBox2_MouseUp);
this.pictureBox2.MouseLeave += new System.EventHandler(this.pictureBox1_MouseLeave);
this.pictureBox2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox2_MouseDown);
//
// pictureBox3
//
this.pictureBox3.BackColor = System.Drawing.Color.Transparent;
this.pictureBox3.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox3.Location = new System.Drawing.Point(156, 210);
this.pictureBox3.Name = "pictureBox3";
this.pictureBox3.Size = new System.Drawing.Size(76, 22);
this.pictureBox3.TabIndex = 2;
this.pictureBox3.TabStop = false;
this.pictureBox3.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBox3_MouseUp);
this.pictureBox3.MouseLeave += new System.EventHandler(this.pictureBox3_MouseLeave);
this.pictureBox3.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox3_MouseDown);
//
// pictureBox4
//
this.pictureBox4.BackColor = System.Drawing.Color.Transparent;
this.pictureBox4.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox4.Location = new System.Drawing.Point(240, 210);
this.pictureBox4.Name = "pictureBox4";
this.pictureBox4.Size = new System.Drawing.Size(76, 22);
this.pictureBox4.TabIndex = 3;
this.pictureBox4.TabStop = false;
this.pictureBox4.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseUp);
this.pictureBox4.MouseLeave += new System.EventHandler(this.pictureBox1_MouseLeave);
this.pictureBox4.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox4_MouseDown);
//
// Form2
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.SystemColors.Control;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(330, 245);
this.Controls.Add(this.pictureBox4);
this.Controls.Add(this.pictureBox3);
this.Controls.Add(this.pictureBox2);
this.Controls.Add(this.pictureBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Form2";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "QQ用户登录";
this.TopMost = true;
this.Click += new System.EventHandler(this.Form2_Click);
this.ResumeLayout(false);
}
#endregion
private void Form2_Click(object sender, System.EventArgs e)
{
MessageBox.Show("说明:/n 体验用C#制作类似QQ窗体停靠的效果!/n请直接按“登录”键进行登录!/n/n 滨州职业学院-软件工程学院/n计算机信息科学系05级软件-水中游制作/n /t/txcligood@gmail.com","QQ界面程序");
}
private void pictureBox3_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.pictureBox3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
}
private void pictureBox3_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
Form1 str =new Form1();//建立一个实例对象名字为str,Form2为新窗体的名字。
str.Show();
this.Hide();
}
private void pictureBox3_MouseLeave(object sender, System.EventArgs e)
{
this.pictureBox3.BorderStyle = System.Windows.Forms.BorderStyle.None ;
}
private void pictureBox2_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
}
private void pictureBox2_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.None ;
}
private void pictureBox1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
}
private void pictureBox1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
Application.Exit();
}
private void pictureBox1_MouseLeave(object sender, System.EventArgs e)
{
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.None ;
this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.None ;
this.pictureBox4.BorderStyle = System.Windows.Forms.BorderStyle.None ;
}
private void pictureBox4_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.pictureBox4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
}
}
}