自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(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 2041

原创 WinForm 窗口最大化(覆盖任务栏)

//窗口最大化(覆盖任务栏) if (this.WindowState == FormWindowState.Maximized) { this.WindowState = FormWindowState.Normal; } else {

2012-08-09 14:23:12 1467

原创 WinForm 判断一个窗口是否被打开

//判断这个窗口是否被打开 如果没打开则按钮可用 否则按钮不可用 if (this.a == null || this.a.IsDisposed) { this.a = new FrmBuilding(); } a.Show();

2012-08-08 15:18:46 1106

原创 WinForm 点击按钮打开新窗口的时候关闭原来的窗口

private Form form=null; //打开窗口前判断在 前面是否打开过别的窗口 是则关闭前1个窗口 void FormShow(Form ff) { ff.Show(); if (form != null) { form.Close

2012-08-08 15:16:33 1092

原创 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 516

原创 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 599

原创 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 2387

原创 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 905

转载 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 790

原创 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 510

原创 WinForm 代码设置FormBorderStyle的属性

this.FormBorderStyle = FormBorderStyle.FixedDialog;

2012-08-03 09:03:20 1338

原创 在WinForm上添加语音朗读功能

点击下载组件 SpeechVoiceSpeakFlags spFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync; SpVoice voice = new SpVoice(); voice.Speak(rtb_contract.Text, spFlags); voice.Resume

2012-07-30 13:45:54 2482

原创 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 876

原创 WinForm 鼠标经过图片 放大

Size szStandard = new Size(); public FrmMain() { InitializeComponent(); foreach (Control ctrl in this.Controls) { if (ctrl is Pictu

2012-07-28 09:25:43 1433 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 3236 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 708

原创 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 2159

原创 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 1162

原创 WinForm 鼠标经过按钮 按钮抖动一下

MouseLeave  是鼠标进过空间的不可见区域事件 MouseEnter 是鼠标进过空间的不可见区域事件 利用这2个事件 鼠标进入空间可见 就把控件移动一下位置 鼠标离开空间 酒吧控件回到原来位置这就是原理 代码如下:  private void ptb_roam_MouseLeave(object sender, EventArgs e)

2012-07-26 16:18:47 469

原创 WinForm 关于点击按钮 链接到 某个父选项卡的第2个子选项卡

this.tabControl1.SelectedTab = tabPage2; 上面代码放在要点击的按钮下 tabPage2 代表要连接到的子选项卡

2012-07-26 16:12:06 1446

原创 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 1515

原创 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 1317

LINQ入门教程(超清)

What‘s LINQ? Language Integrated Query 是也。说得再明白一些,这是 编程语言的一种新特性,能够将数据查询语句集成到编程语言中。目前, LINQ 支持的语言有 C# 和 VB。 为啥会有 LINQ,主要还是因为现在的数据格式越来越多,数据库、 XML、 数组、哈希表……每一种都有自己操作数据的方式,学起来费事费力。于是,就 有了 LINQ 诞生的理由——以一种统一的方式操作各种数据源,减少数据访问的 复杂性。 LINQ 带来很多开发上的便利。首先,他可以利用 Visual Studio 这个强大的 IDE(这话决不是吹, Visual Studio 绝对是最好用的开发工具之一), 至少用 Visual Studio 来写 SQL 语句,可以有智能感知了,比起从前用查询分析器写存储过程 的感觉好多了!其次, 它可以把数据当成一个对象来操作, 即 Data == Object? 的 问题。 LINQ 目前可以对 XML, Object, SQL 做数据访问, 今后还会有 LINQ to Entity 的功能。

2015-02-06

C#语言包(WIn7系统)VS2010

语言包 VS WinFrom 2010VS C#

2012-07-30

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除