博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 75 下一页

2013年6月21日

摘要: sp_send_dbmail[[@profile_name=]'profile_name'][,[@recipients=]'recipients[;n]'][,[@copy_recipients=]'copy_recipient[;n]'][,[@blind_copy_recipients=]'blind_copy_recipient[;n]'][,[@subject=]'subject'][,[@body=]'body'][,[@body_format=]'body_format' 阅读全文

posted @ 2013-06-21 16:46 moss_tan_jun 阅读(2162) 评论(0) 推荐(0) 编辑

2013年3月25日

摘要: 这些技巧不好找,我归类总结了一下,对大家访问使用也方便,好了,列表如下:1.怎样定制VC#DataGrid列标题? DataGridTableStyledgts=newDataGridTableStyle(); dgts.MappingName="myTable";//myTable为要载入数据的DataTable DataGridTextBoxColumndgcs=newDataGridTextBoxColumn(); dgcs.MappingName="title_id"; dgcs.HeaderText="标题ID"; dgts 阅读全文

posted @ 2013-03-25 13:54 moss_tan_jun 阅读(572) 评论(0) 推荐(0) 编辑

摘要: 使用Regex类需要引用命名空间:using System.Text.RegularExpressions;利用Regex类实现验证示例1:注释的代码所起的作用是相同的,不过一个是静态方法,一个是实例方法var source = "刘备关羽张飞孙权";//Regex regex = new Regex("孙权");//if (regex.IsMatch(source))//{// Console.WriteLine("字符串中包含有敏感词:孙权!");//}if (Regex.IsMatch(source, "孙权" 阅读全文

posted @ 2013-03-25 10:33 moss_tan_jun 阅读(302) 评论(0) 推荐(0) 编辑

2013年1月8日

摘要: 程序很简单,用的时候需要提供pageCount(页数),pageShow(显示的页数),currPage(当前页号)控件提供一个自定义的事件LnkLblClicked,当用户点击页面链接的时候就会触发这个事件。下面是程序的源码。usingSystem;usingSystem.Collections;usingSystem.ComponentModel;usingSystem.Drawing;usingSystem.Data;usingSystem.Windows.Forms;namespaceActiveButton{/**////<summary>///Summarydescri 阅读全文

posted @ 2013-01-08 10:53 moss_tan_jun 阅读(333) 评论(0) 推荐(0) 编辑

摘要: Windows Forms DataGridView 没有提供合并单元格的功能,要实现合并单元格的功能就要在CellPainting事件中使用Graphics.DrawLine和 Graphics.DrawString 自己来“画”。下面的代码可以对DataGridView第1列内容相同的单元格进行合并: private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { // 对第1列相同单元格进行合并 if (e.ColumnIndex == 0 && e 阅读全文

posted @ 2013-01-08 10:49 moss_tan_jun 阅读(366) 评论(0) 推荐(0) 编辑

摘要: 窗体的show方法,没有给调用代码任何通知,如果需要通知,使用showdialog是一种好的选择。在调用show方法后,show方法后面的代码会立即执行,调用showdialog方法后,调用代码被暂停执行,等到调用showdialog方法的窗体关系后再继续执行。而且窗体可以返回一个dialogresult值,他描述了窗体关闭的原因,例如OK,Cancel,yes,no等。为了让窗体返回一个dialogresult,必须设置窗体的dialogresult值,或者在窗体的一个按钮上设置dialogresult属性。例子:下面是子窗体代码,要求输入phone,然后会返回给父窗体。usingSyste 阅读全文

posted @ 2013-01-08 10:42 moss_tan_jun 阅读(966) 评论(0) 推荐(0) 编辑

摘要: 在C#的WinForm程序中,有的时候需要判定关闭请求从哪里发出来的。比如是用户点击了右上角的“关闭”按钮,还是调用了WinForm.Close()方法。最典型的是要知道点击右上角的“关闭”按钮发出的事件。下面这个方法可以判断这点:protected override void WndProc(refMessage msg) { const int WM_SYSCOMMAND = 0x0112;const int SC_CLOSE = 0xF060; if (msg.Msg == WM_SYSCOMMAND&& ((int)msg.WParam == SC_CLOSE)){// 阅读全文

posted @ 2013-01-08 10:40 moss_tan_jun 阅读(1587) 评论(0) 推荐(0) 编辑

摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;namespaceWindowsApplication4{publicpartialclassfrmMain:Form{publicfrmMain(){InitializeComponent();}privatevoid登录ToolStripMenuItem_Click(objectsender, 阅读全文

posted @ 2013-01-08 10:39 moss_tan_jun 阅读(495) 评论(0) 推荐(0) 编辑

摘要: 在开发的时候经常使用treeview控件来显示组织结构啊,目录结构啊,通常会结合属性checkedboxs,来做选中,取消的操作下面是一个选中,取消的小例子,选中节点的时候,如果节点存在子节点,可以选中全部的子节点;如果取消一个节点的选中状态,当前节点同时又存在父节点的话,就取消父节点的选中状态。如图所示:代码如下:CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->usingSystem;usingSystem.Collections. 阅读全文

posted @ 2013-01-08 10:29 moss_tan_jun 阅读(827) 评论(0) 推荐(0) 编辑

摘要: 原代码:privatevoidtextBox1_KeyPress(objectsender,KeyPressEventArgse){if(!char.IsDigit(e.KeyChar))e.Handled=true;//'\b'是退格键值if(e.KeyChar=='\b'||e.KeyChar=='.')e.Handled=false;}以上代码是无法限制全角数字输入的.而在项目中全角数字是不能算真正的数字,因为在参加计算时全角可能会出错.修改的代码:privatevoidtextBox1_KeyPress(objectsender,KeyP 阅读全文

posted @ 2013-01-08 10:19 moss_tan_jun 阅读(659) 评论(0) 推荐(2) 编辑

上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 75 下一页