相关笔记
-工作笔记-Gridview部分
-工作笔记-Datatable部分
-工作笔记-字段处理部分
-工作笔记-数据验证和数据传输
-工作笔记-SQL语句部分
-工作笔记-页面样式部分
-工作笔记-Winform部分
-工作笔记-文件处理部分
-工作笔记-下拉列表部分
-工作笔记-存储过程部分
1)获取系统分辨率
int width = Screen.PrimaryScreen.Bounds.Width;
2)设置控件坐标
this.panel4.Location = new Point(276, 0);
3)获取控件x坐标
string a = (this.panel4.Location.X).ToString();
4)设置鼠标光标为等待状态
Cursor.Current = Cursors.WaitCursor;
设置鼠标光标为默认光标
Cursor.Current = Cursors.Default;
5)只打开文件夹:(Explorer.exe是执行程序)
System.Diagnostics.Process.Start("Explorer.exe", @"E:\Training");
打开程序:
System.Diagnostics.Process.Start("Explorer.exe", @"E:\Training\a.exe");
打开文件夹并选中文件夹:
System.Diagnostics.Process.Start("Explorer.exe", @"/select,E:\Training\js");
打开文件夹并选中文件:
System.Diagnostics.Process.Start("Explorer.exe", @"/select,E:\Training\20131250.html");
6)创建线程
1.调用 using System.Threading;
2.公有方法 Thread RQcode;
3.窗体载入
RQcode = new Thread(new ThreadStart(LookRQPrint));
RQcode.IsBackground = true;
RQcode.Start();//开启线程
4.运行的方法(死循环)
public void LookRQPrint()
{
while (true)
{
MessageBox.Show("3秒出现一次");
Thread.Sleep(3000);
//RQcode.Abort();//结束线程(有待考察)
}
}