using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication10
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
skinEngine1.SkinFile = "XPOrange.ssk";
}
private void picshowpicture_Click(object sender, EventArgs e)
{
}
private void btnQuit_Click(object sender, EventArgs e)
{
//退出
this.Close();
}
private void bubtnselectpicture_Click(object sender, EventArgs e)
{
if (ofdSelectPicture .ShowDialog () == DialogResult .OK ) //如果ofdSelectPicture窗口点击确定!
{
picshowpicture .Image = Image .FromFile (ofdSelectPicture .FileName ); //那么图形控件的图片等于它选择的文件。
this .Text = string .Concat ("Picture View("+ofdSelectPicture .FileName +")");
}
}
private void Form1_Load(object sender, EventArgs e)
{
lblx.Text = "";
lbly.Text = "";
tuopannot.Text = this.Text;
tuopannot.Visible = false;
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
//图形框不等于空。
if (picshowpicture.Image != null)
{
MessageBox.Show("PictureBox .Image != null", "错误");
}
else
{
skinEngine1.SkinFile = "Vista2_color7.ssk";
}
skinEngine1.SkinFile = "Vista2_color7.ssk";
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
//图形框不等于空。
if (picshowpicture.Image != null)
{
MessageBox.Show("PictureBox .Image != null", "错误");
}
else
{
skinEngine1.SkinFile = "vista1.ssk";
}
skinEngine1.SkinFile = "vista1.ssk";
}
private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
//图形框不等于空。
if (picshowpicture.Image != null)
{
MessageBox.Show("PictureBox .Image != null", "错误");
}
else
{
skinEngine1.SkinFile = "XPOrange.ssk";
}
skinEngine1.SkinFile = "XPOrange.ssk";
}
private void btn1_Click(object sender, EventArgs e)
{
//窗口高和宽增加20
this.Width += 20;
this.Height += 20;
}
private void button2_Click(object sender, EventArgs e)
{
//窗口高和宽减少20
this.Width -= 20;
this.Height -= 20;
}
private void btnhuifu_Click(object sender, EventArgs e)
{
//
this.Width = 700;
this.Height = 550;
}
private void picshowpicture_MouseMove(object sender, MouseEventArgs e)
{
lblx.Text = "X: " + e.X.ToString();
lbly.Text = "Y:" + e.Y.ToString();
}
private void picshowpicture_MouseLeave(object sender, EventArgs e)
{
lblx.Text = "";
lbly.Text = "";
}
private void Form1_Deactivate(object sender, EventArgs e)
{
//判断是否点击最小化。
if (WindowState == FormWindowState.Minimized)
{
tuopannot.Visible = true;
this.Visible = false;
}
}
private void tuopannot_Click(object sender, EventArgs e)
{
//托盘及窗口的可见性
tuopannot.Visible = false;
this.Visible = true;
this.WindowState = FormWindowState.Normal;
}
}
}