摘要:using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Data.SqlClient; using System.Windows.Forms; using System.Drawing; namespace RZGY { class LinkDB...
阅读全文
随笔分类 - [B] WinForm开发(C#)
摘要:一、部署 C# 应用程序 部署是分发要安装到其他计算机上的已完成应用程序或组件的过程。对于控制台应用程序或基于 Windows 窗体的智能客户端应用程序,有两个部署选项可供选择:ClickOnce 和 Windows Installer。 ClickOnce 部署 ClickOnce(Visual Studio 2000和NET Framework 2.0 的一个功...
阅读全文
摘要:方法引用于:http://www.cnblogs.com/javaca88/archive/2006/10/26/540827.html private void tvSysFunctionMenu_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Node != tvS...
阅读全文
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Text; using System.Windows.Forms; nam...
阅读全文
摘要://Author:Stephen.Ju //Date:2007-08-10 using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Data.SqlClient; using System.Windows.Forms; using System.Dra...
阅读全文
摘要:最近在园子里看了几篇相关的文章,总结了一下(还请多多指正): Delete()是面向对象状态操作的(可以回滚);RemoveAt()是面向普通集合操作的(不可以回滚,等价于先Delete()后AcceptChanges()) DataTable.AcceptChanges方法提交自上次调用 AcceptChanges 以来对该表进行的所有更改。调用 AcceptChanges 时,任何仍处于...
阅读全文
摘要:dataGridView设计如下图:代码如下: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.SqlClient;using System.Drawing;using System.Text;using System.Wind...
阅读全文
摘要:using System;using System.DirectoryServices;namespace test{ public partial class CreateNewAccount: Form { public CreateNewAccount() { InitializeComponent(); } ...
阅读全文
摘要:WINFORM界面如下:本文用了2张表,结构如下:表province: province_id province_name 表city: city_id city_name province_id完整代码如下: using System;using System.Collections.Generic;using System.ComponentModel;usin...
阅读全文
摘要:TreeView 是一个很好的表达树形结构的控件。如果要加载的数据比较多的话,就需要逐层加载数据。要实现逐层加载数据,首先想到的就是TreeView 的 BeforeExpand 事件,它在节点展开前触发。但问题是BeforeExpand 事件每次展开时都会触发。有没有只在首次展开才触发的事件呢,可惜没找到。没关系,我们自定义一个 TreeView 节点类,给它加一个是否首次被展开的属性。 ...
阅读全文
摘要:private void btnChangeIndex_Click(object sender, EventArgs e) { object objItem = this.listBox1.Items[i]; this.listBox1.Items.RemoveAt(0); this.listBox1.Items.I...
阅读全文
摘要:一共有4种实现方法 Using constructor Using objects Using properties Using delegates 这里主要介绍方法3、4 方法3: Step 1: Add a property in form1 to retrieve value from textbox. public string _sendt...
阅读全文
摘要:SqlConnection conn = new SqlConnection("server=zzy;integrated security=sspi;database=library"); SqlCommand cmd; private void btninsert_Click(object sender, EventArgs e) { ...
阅读全文
摘要:有2张表,结构如下:表province结构:province_id province_name ( primary key:province_id)表city结构:city_id,city_name,province_id (primary key:city_id,province_id) SqlConnection conn = new SqlConnecti...
阅读全文
摘要:private void btnBold_Click(object sender, EventArgs e) { Font oldfont, newfont; oldfont = this.richTextBox1.SelectionFont;//获取选定字的字体格式 if (oldfont.Bold) ...
阅读全文
摘要://方法1 private void btnQuery_DayOfWeek_Click(object sender, EventArgs e) { MessageBox.Show("今天是:"+"日一二三四五六".Substring((int)DateTime.Now.DayOfWeek,1); } //方法2 //必...
阅读全文
摘要://KeyPress事件:当控件获得焦点,并且用户按下且释放键盘上的键后发生 private void textBox1_KeyPress(object sender, KeyPressEventArgs e)//文本框只接受数字的输入和小数点 { //IsNumber:指定字符串中位于指定位置的字符是否属于数字类别 //I...
阅读全文
摘要://在DataGridView中显示行号,需要要处理DataGridView的RowPostPaint事件: private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { SolidBrush B = new SolidB...
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.SqlClient;using System.Drawing;using System.Text;using System.Windows.Forms;using System...
阅读全文
摘要:一、登录界面及更改密码界面二、创建存储过程1、pr_login CREATE proc pr_login@id varchar(10), --输入参数@pwd varchar(10), --输入参数@result varchar(10) output --输出参数asselect * from login where 登录工号=@idif(@@...
阅读全文

浙公网安备 33010602011771号