資源簡介
winform實例代碼集合,包含窗體操作技巧、控件操作技巧、圖像操作、打印幫助類、系統(tǒng)操作類、文件處理類等200個實例代碼
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
using?System.Runtime.InteropServices;
namespace?QQFrm
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????#region??公共變量
????????IntPtr?Tem_Handle;//獲取控件及窗體的句柄
????????Point?CPoint;//獲取控件中鼠標的坐標
????????static?int?Tem_place?=?0;
????????int?Frm_Height?=?0;
????????int?FrmHeight?=?0;
????????#endregion
????????#region??API聲明
????????//獲取當前鼠標下可視化控件的句柄
????????[DllImport(“user32.dll“)]
????????public?static?extern?int?WindowFromPoint(int?xPoint?int?yPoint);
????????//獲取指定句柄的父級句柄
????????[DllImport(“user32.dll“?ExactSpelling?=?true?CharSet?=?CharSet.Auto)]
????????public?static?extern?IntPtr?GetParent(IntPtr?hWnd);
????????//獲取屏幕的大小
????????[DllImport(“user32.dll“?EntryPoint?=?“GetSystemMetrics“)]
????????private?static?extern?int?GetSystemMetrics(int?mVal);
????????#endregion
????????#region??獲取當前鼠標下可視化控件的句柄
????????///?
????????///?獲取當前鼠標下可視化控件的句柄
????????///?
????????///?當前鼠標的X坐標
????????///?當前鼠標的Y坐標
????????public?IntPtr?FormNameAt(int?x?int?y)
????????{
????????????IntPtr?Tem_hWnd;//設置存儲句柄的變量
????????????Tem_Handle?=?(IntPtr)(WindowFromPoint(x?y));//獲取當前鼠標下可視化控件的句柄
????????????Tem_hWnd?=?Tem_Handle;//記錄原始句柄
????????????while?(Tem_hWnd?!=?((IntPtr)0))//遍歷該句柄的父級句柄
????????????{
????????????????Tem_Handle?=?Tem_hWnd;//記錄當前句柄
????????????????Tem_hWnd?=?GetParent(Tem_hWnd);//獲取父級句柄
????????????}
????????????return?Tem_Handle;//返回最底層的父級句柄
????????}
????????#endregion
????????private?void?timer1_Tick(object?sender?EventArgs?e)
????????{
????????????if?(this.Top?3?&&?Tem_place==0)//如果窗體被移到屏幕的頂部
????????????????{
????????????????????if?(this.Handle?==?FormNameAt(Cursor.Position.X?Cursor.Position.Y))//當鼠標移致到該窗體上
????????????????????{
????????????????????????panel_title.Tag?=?1;//設置標識,用于判斷窗體在屏幕頂部
????????????????????????timer2.Enabled?=?false;//不對窗體進行拉伸操作
????????????????????????this.Top?=?0;//使窗體致頂
????????????????????}
????????????????????else
????????????????????{
????????????????????????panel_title.Tag?=?1;//設置標識,用于判斷窗體在屏幕頂部
????????????????????????timer2.Enabled?=?true;//將窗體在頂部進行隱藏
????????????????????}
????????????????}
????????????????else
????????????????{
????????????????????if?(this.Left?3?||?this.Right?>?GetSystemMetrics(0)?-?3)//如果窗體被移到屏幕的左端或右端
????????????????????{
????????????????????????if?(this.Left?3)//如果窗體被移到屏幕的左端
????????????????????????{
????????????????????????????if?(this.Handle?==?FormNameAt(Cursor.Position.X?Cursor.Position.Y))//當鼠標移致到該窗體上
????????????????????????????{
????????????????????????????????panel_title.Tag?=?2;//設置標識,用于判斷窗體在屏幕左端
????????????????????????????????timer2.Enabled?=?false;
?????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????15360??2008-12-29?14:52??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\bin\Debug\CPU_Detect.exe
?????文件??????36352??2008-12-29?14:52??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\bin\Debug\CPU_Detect.pdb
?????文件??????14328??2009-02-11?13:19??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\bin\Debug\CPU_Detect.vshost.exe
?????文件????????490??2007-07-21?01:33??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\bin\Debug\CPU_Detect.vshost.exe.manifest
?????文件???????3864??2008-12-04?13:28??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\CPU_Detect.csproj
?????文件???????3853??2008-12-29?15:17??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\Form1.cs
?????文件??????15711??2008-12-29?10:09??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\Form1.Designer.cs
?????文件???????6209??2008-12-29?10:09??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\Form1.resx
?????文件???????1966??2009-02-11?13:19??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\obj\Debug\CPU_Detect.csproj.FileListAbsolute.txt
?????文件????????910??2008-12-29?10:09??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\obj\Debug\CPU_Detect.csproj.GenerateResource.Cache
?????文件??????15360??2008-12-29?14:52??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\obj\Debug\CPU_Detect.exe
?????文件????????180??2008-12-29?10:09??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\obj\Debug\CPU_Detect.Form1.resources
?????文件??????36352??2010-08-18?17:50??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\obj\Debug\CPU_Detect.pdb
?????文件????????180??2008-12-04?13:33??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\obj\Debug\CPU_Detect.Properties.Resources.resources
?????文件????????491??2008-12-03?15:34??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\Program.cs
?????文件???????1380??2008-12-29?10:08??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\Properties\AssemblyInfo.cs
?????文件???????2870??2008-12-03?15:34??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\Properties\Resources.Designer.cs
?????文件???????5612??2008-12-03?15:34??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\Properties\Resources.resx
?????文件???????1095??2008-12-03?15:34??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\Properties\Settings.Designer.cs
?????文件????????249??2008-12-03?15:34??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect\Properties\Settings.settings
?????文件????????920??2008-12-03?15:34??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect.sln
????..A..H.?????14336??2009-02-11?13:49??5-系統(tǒng)操作\CPU內存使用率\CPU_Detect.suo
?????文件???????1406??2008-12-09?10:43??5-系統(tǒng)操作\動態(tài)圖標顯示\DynamicTaskStock\1.ico
?????文件???????2862??2008-12-09?10:39??5-系統(tǒng)操作\動態(tài)圖標顯示\DynamicTaskStock\2.ico
?????文件???????2862??2008-12-09?10:43??5-系統(tǒng)操作\動態(tài)圖標顯示\DynamicTaskStock\3.ico
?????文件??????23040??2008-12-29?10:21??5-系統(tǒng)操作\動態(tài)圖標顯示\DynamicTaskStock\bin\Debug\DynamicTaskStock.exe
?????文件??????32256??2008-12-29?10:21??5-系統(tǒng)操作\動態(tài)圖標顯示\DynamicTaskStock\bin\Debug\DynamicTaskStock.pdb
?????文件??????14328??2009-02-10?08:59??5-系統(tǒng)操作\動態(tài)圖標顯示\DynamicTaskStock\bin\Debug\DynamicTaskStock.vshost.exe
?????文件????????490??2007-07-21?01:33??5-系統(tǒng)操作\動態(tài)圖標顯示\DynamicTaskStock\bin\Debug\DynamicTaskStock.vshost.exe.manifest
?????文件???????3945??2008-12-09?10:44??5-系統(tǒng)操作\動態(tài)圖標顯示\DynamicTaskStock\DynamicTaskStock.csproj
............此處省略6915個文件信息
- 上一篇:ProEssentials v7破解版
- 下一篇:C#SharpAvi桌面錄屏源碼
評論
共有 條評論