- 博客(22)
- 资源 (2)
- 收藏
- 关注
转载 .net 注册帐号时邮箱激活
public void SendSMTPEMail(string strSmtpServer, string strFrom, string strFromPass, string strto, string strSubject, string strBody) { System.Net.Mail.SmtpClient client = new Smt
2013-09-04 00:28:52
2104
原创 WinForm 窗口最大化(覆盖任务栏)
//窗口最大化(覆盖任务栏) if (this.WindowState == FormWindowState.Maximized) { this.WindowState = FormWindowState.Normal; } else {
2012-08-09 14:23:12
1538
原创 WinForm 判断一个窗口是否被打开
//判断这个窗口是否被打开 如果没打开则按钮可用 否则按钮不可用 if (this.a == null || this.a.IsDisposed) { this.a = new FrmBuilding(); } a.Show();
2012-08-08 15:18:46
1163
原创 WinForm 点击按钮打开新窗口的时候关闭原来的窗口
private Form form=null; //打开窗口前判断在 前面是否打开过别的窗口 是则关闭前1个窗口 void FormShow(Form ff) { ff.Show(); if (form != null) { form.Close
2012-08-08 15:16:33
1151
原创 WinForm 关于窗口从中间逐渐变大
int Width = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;// int Height = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;//获取屏幕大小 this.Size = new Size(0, 0);
2012-08-08 10:21:51
561
原创 WinFrom中实现点击关闭按钮窗口在靠屏幕左边中间缓缓收缩
private void btn_close_Click(object sender, EventArgs e) { timer_close.Start(); } int _X = 0; int _Y = 0; private void timer_close_Tick(object sende
2012-08-06 19:44:38
634
原创 WinForm 窗口出现在靠屏幕左边中间或者右边中间
//设置窗体在屏幕左下角显示 int x = Screen.PrimaryScreen.WorkingArea.Left; int y = 120; this.Location = new Point(x, y); //窗口在右下角显示 int x = Screen.Prima
2012-08-06 19:41:29
2552
原创 WinForm下点击按钮关闭项目所有的窗口(其实就是结束这个项目进程)
private void pbx_Exit_Click(object sender, EventArgs e) { Process[] pros = Process.GetProcesses(); for (int i = 0; i < pros.Length; i++) { i
2012-08-06 19:38:13
980
转载 WinForm 按ESC 提示是否要关闭
//按ESC 提示是否要退出 protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) //激活回车键 { int WM_KEYDOWN = 256; in
2012-08-04 10:40:04
846
原创 WinForm 窗口上假如Flash
需要添加一个COM 组件 只要你的机器安装了Flash在下面目录中C:\Windows\System32\Macromed\Flash找到Flash32_11_3_300_268.ocx 也许你的版本不一样 所以看文件类型是.ocx的添加就OK在WinForm窗口中添加Shockwave Flash Object组件在窗口加载事件中写入 以下代码即可(你的Flash文件在\b
2012-08-04 09:57:18
541
原创 WinForm 代码设置FormBorderStyle的属性
this.FormBorderStyle = FormBorderStyle.FixedDialog;
2012-08-03 09:03:20
1403
原创 在WinForm上添加语音朗读功能
点击下载组件 SpeechVoiceSpeakFlags spFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync; SpVoice voice = new SpVoice(); voice.Speak(rtb_contract.Text, spFlags); voice.Resume
2012-07-30 13:45:54
2570
原创 WinForm 选项卡在左边(虽然可以直接设置但是文字错误方向,也许是VS2010的BUG)
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Drawing.Drawing2D;usi
2012-07-28 11:16:23
949
原创 WinForm 鼠标经过图片 放大
Size szStandard = new Size(); public FrmMain() { InitializeComponent(); foreach (Control ctrl in this.Controls) { if (ctrl is Pictu
2012-07-28 09:25:43
1524
2
原创 WinForm 圆形按钮
Button btn = sender as Button; System.Drawing.Drawing2D.GraphicsPath btnPath = new System.Drawing.Drawing2D.GraphicsPath(); System.Drawing.Rectangle newRectangle = btn.ClientRe
2012-07-28 08:44:01
3323
1
原创 WinForm 闪屏实现
其实就是新建的一个Windows窗体设置隐藏了标题栏和边框 FormBorderStyle为None System.Windows.Forms.Timer timer = new Timer(); private void FrmFlashScreen_Load(object sender, EventArgs e) { t
2012-07-26 17:00:49
748
原创 WinForm 点击按钮把用户输入的信息导入到Word并以系统时间命名 然后打开这个Word所在文件夹
前提:你所在的程序目录每一层目录不能的文件夹名不能有符号 不然会报错DateTime.Now.ToString("MM月dd日hh时mm分", DateTimeFormatInfo.InvariantInfo) 是获取系统时间格式是:"MM月dd日hh时mm分" 可随着自己的愿望改变StreamWriter f = File.CreateText("合同书/"+path) 创建并把把文字
2012-07-26 16:46:28
2196
原创 WinForm Timer控件实现几秒后继续的提示
btn_look 按钮是提示几秒后继续btn_ok 按钮是0秒后跳出来的可用按钮 其实就是btn_look这个不可用按钮倒计时完后 跳出可用的btn_ok按钮 private void time_contract_Tick(object sender, EventArgs e) { this.btn_lo
2012-07-26 16:31:12
1225
原创 WinForm 鼠标经过按钮 按钮抖动一下
MouseLeave 是鼠标进过空间的不可见区域事件 MouseEnter 是鼠标进过空间的不可见区域事件 利用这2个事件 鼠标进入空间可见 就把控件移动一下位置 鼠标离开空间 酒吧控件回到原来位置这就是原理 代码如下: private void ptb_roam_MouseLeave(object sender, EventArgs e)
2012-07-26 16:18:47
512
原创 WinForm 关于点击按钮 链接到 某个父选项卡的第2个子选项卡
this.tabControl1.SelectedTab = tabPage2; 上面代码放在要点击的按钮下 tabPage2 代表要连接到的子选项卡
2012-07-26 16:12:06
1487
原创 WinForm 关于鼠标划过控件提示消息
ToolTip toolTip1 = new ToolTip(); toolTip1.AutoPopDelay = 5000; toolTip1.InitialDelay = 500; toolTip1.ReshowDelay = 500; toolTip1.ShowAlways = true; toolTip1.SetToo
2012-07-26 16:08:41
1562
原创 WinForm中添加电子地图(定点位置)
新建html文件写入一下代码 html {height: auto;} body {height: auto;margin: 0;padding: 0;border:0px;overflow:hidden;} #map_canvas {width:1100px;height: 600px;position: absolute;} @media print {#map_c
2012-07-24 09:45:48
1421
LINQ入门教程(超清)
2015-02-06
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人