标签:winform style blog color os io ar for art
1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Linq; 7 using System.Text; 8 using System.Windows.Forms; 9 using System.Xml; 10 using System.Runtime.InteropServices; 11 12 namespace WindowsFormsApplication1 13 { 14 public partial class Main : Form 15 { 16 public Main() 17 { 18 this.KeyPreview = true; 19 InitializeComponent(); 20 //TopMost = true; 21 LoadMax(); 22 } 23 24 private void picXS_Click(object sender, EventArgs e) 25 { 26 Form1 form = new Form1(); 27 this.Hide(); 28 form.Show(); 29 } 30 31 private void pictureBox1_Click(object sender, EventArgs e) 32 { 33 if (MessageBox.Show("确认注销吗?", "请确认", MessageBoxButtons.YesNo) == DialogResult.Yes) 34 { 35 36 Login login = new Login(); 37 this.Hide(); 38 login.Show(); 39 } 40 } 41 42 private void pictureBox2_Click(object sender, EventArgs e) 43 { 44 SelectShowInfo select = new SelectShowInfo(); 45 this.Hide(); 46 select.Show(); 47 } 48 49 private void pictureBox3_Click(object sender, EventArgs e) 50 { 51 52 SubInfo info = new SubInfo(); 53 this.Hide(); 54 info.Show(); 55 56 57 } 58 59 private void Main_Load(object sender, EventArgs e) 60 { 61 62 } 63 64 65 66 public void LoadMax() 67 { 68 if (this.WindowState == FormWindowState.Maximized) 69 { 70 this.WindowState = FormWindowState.Normal; 71 } 72 else 73 { 74 this.FormBorderStyle = FormBorderStyle.None; 75 this.WindowState = FormWindowState.Maximized; 76 } 77 } 78 79 80 81 private void pictureBox5_Click(object sender, EventArgs e) 82 { 83 SubSummary subsum = new SubSummary(); 84 this.Hide(); 85 subsum.Show(); 86 } 87 88 89 90 private void Form1_KeyDown(object sender, KeyEventArgs e) 91 { 92 93 94 95 } 96 97 private void Main_KeyDown(object sender, KeyEventArgs e) 98 { 99 if (e.KeyCode == Keys.F7) 100 { 101 WEB main = new WEB(); 102 this.Hide(); 103 104 main.Show(); 105 } 106 107 108 109 110 if (e.KeyCode == Keys.NumPad1) 111 { 112 picXS_Click(sender, e); 113 114 } 115 116 if (e.KeyCode == Keys.NumPad2) 117 { 118 pictureBox2_Click(sender, e); 119 120 } 121 122 if (e.KeyCode == Keys.NumPad3) 123 { 124 pictureBox5_Click(sender, e); 125 126 } 127 128 if (e.KeyCode == Keys.NumPad4) 129 { 130 pictureBox3_Click(sender, e); 131 132 } 133 134 if (e.KeyCode == Keys.NumPad5) 135 { 136 pictureBox1_Click(sender, e); 137 138 } 139 140 if (e.KeyCode == Keys.NumPad6) { 141 picBminPwd_Click(sender,e); 142 } 143 144 //禁止相关快捷键 145 if (e.Modifiers == Keys.Alt 146 || e.Modifiers == Keys.LWin 147 || e.Modifiers == Keys.RWin 148 ) 149 { 150 e.Handled = true; 151 } 152 153 //弹出Password窗体 154 //if (e.Alt == true) 155 //{ 156 // PassWords password = new PassWords(); 157 // e.Handled = false; 158 // password.Show(); 159 //} 160 } 161 162 private void picBminPwd_Click(object sender, EventArgs e) 163 { 164 165 PassWords pwd = new PassWords(); 166 pwd.ShowDialog(); 167 168 } 169 170 171 ////倒计时 172 //[StructLayout(LayoutKind.Sequential)] 173 174 //struct LASTINPUTINFO 175 //{ 176 // [MarshalAs(UnmanagedType.U4)] 177 // public int cbSize; 178 179 // [MarshalAs(UnmanagedType.U4)] 180 // public uint dwTime; 181 //} 182 183 //[DllImport("user32.dll")] 184 185 //static extern bool GetLastInputInfo(ref LASTINPUTINFO plii); 186 187 //static long GetLastInputTime() 188 //{ 189 // LASTINPUTINFO vLastInputInfo = new LASTINPUTINFO(); 190 // vLastInputInfo.cbSize = Marshal.SizeOf(vLastInputInfo); 191 192 // if (!GetLastInputInfo(ref vLastInputInfo)) 193 194 // return 0; 195 196 // return Environment.TickCount - (long)vLastInputInfo.dwTime; 197 //} 198 199 //private void timer1_Tick(object sender, EventArgs e) 200 //{ 201 // if (GetLastInputTime() > 3000) 202 // { 203 // timer1.Stop(); 204 205 // Screen screen = new Screen(); 206 207 // this.Hide(); 208 209 // screen.Show(); 210 // } 211 //} 212 213 214 } 215 }
标签:winform style blog color os io ar for art
原文地址:http://www.cnblogs.com/MarkTang/p/3962794.html