日期:2014-05-17 浏览次数:20817 次
using System;
using System.Windows.Forms;
namespace 自定义最大小化和关闭按钮
{
public partial class frm_Main : Form
{
public frm_Main()
{
InitializeComponent();
}
private void frm_Main_Load(object sender, EventArgs e)
{
this.Width = Properties.Resources.登录界面标题.Width;
this.Height = Properties.Resources.登录界面标题.Height + Properties.Resources.登录界面下面.Height;
panel_Title.BackgroundImage = Properties.Resources.登录界面标题;
panel_All.BackgroundImage = Properties.Resources.登录界面下面;
pictureBox_Min.Image = null;//清空PictureBox控件
pictureBox_Min.Image = Properties.Resources.最小化按钮;
pictureBox_Max.Image = null;
pictureBox_Max.Image = Properties.Resources.最大化按钮;
pictureBox_Close.Image = null;
pictureBox_Close.Image = Properties.Resources.关闭按钮;
}
//自定义方法ImageSwitch主要是在鼠标移入和移出控件时对图片进行切换
#region 控制图片的切换状态
public static PictureBox Tem_PictB = new PictureBox();//创建PictureBox控件
/// <summary>
/// 控制图片的切换状态
/// </summary>
/// <param name="sender">要改变图片的对象</param>
/// <param name="n">控件标识</param>