![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c# winform
im000409
慢慢学习,不断充实自己
展开
-
c#excel导入datagridview
/// /// 点击按钮导入数据 /// 作者:lhxhappy /// /// /// private void button1_Click(object sender, E原创 2011-09-12 12:40:55 · 750 阅读 · 0 评论 -
xml 类
using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts转载 2011-11-28 20:32:39 · 275 阅读 · 0 评论 -
截断双击标题栏事件
/// /// 截断双击标题栏事件 /// /// protected override void WndProc(ref Message m) { if (m.Msg != 0xA3) base.WndProc(ref m); }转载 2011-12-02 12:14:32 · 502 阅读 · 0 评论 -
简单验证软件版本和限定日期,通过网络上的XML
XDocument xmlDoc = XDocument.Load("http://www.xxx.com/xxx.xml"); if (Convert.ToDateTime(xmlDoc.Root.Element("checkDate").Value) > DateTime.Now) { if (xmlDoc.Roo原创 2011-12-02 12:16:25 · 344 阅读 · 0 评论 -
窗口最大化且不遮挡状态栏的简单办法!
1、属性中 MaximizeBox 和 MinimizeBox 必须设置为True2、WindowState 设置为Maximized 3、如果需要关闭最大化按钮,在load事件添加this.MaximizeBox = false;即可如果双击标题栏恢复小窗口的话可以参照博客内另一篇文章:截断双击标题栏事件。原创 2011-12-02 12:20:15 · 3240 阅读 · 0 评论 -
关于c# 和 SQL SERVER 2000 日期比较查询的一点点经验,记录一下,免得忘记!
sql 日期查询用 between ... and ,在实际应用中发现 必须格式一样才可以比较,例如下列代码:where CONVERT(varchar(10), 查询日期, 25) between '2011-09-21' and '2011-09-22' 这是通过C#的日期控件选择的时间需要格式化一下 才能符合条件date1.toString("yyyy-MM-dd")经测试下原创 2011-12-18 13:45:46 · 773 阅读 · 0 评论 -
sql 2000 server 重复数据查询
select * from 规格码 where 规格码 in (select 规格码 from 规格码 group by 规格码 having count(规格码) > 1)转载 2012-02-07 17:23:32 · 397 阅读 · 0 评论 -
DGV 指定列 只允许输入“数字和小数点(金额)” 和“数字”
#region DGV指定列只允许输入数字和小数点(一个小数点) 类似金额 public DataGridViewTextBoxEditingControl CellEdit { get; set; }//声明一个CellEdit public void gridEnter_EditingControlShowing(object sender, Data转载 2012-05-17 21:53:08 · 829 阅读 · 0 评论 -
dataGridView右键菜单并选中该行
dataGridView右键菜单并选中该行程序代码:private void dataGridView1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { if (e.Button == MouseButtons.Right) {转载 2012-05-17 16:33:07 · 828 阅读 · 0 评论 -
四舍五入
public double ChinaRound(double value, int decimals) { if (value < 0) { return Math.Round(value + 5 / Math.Pow(10, decimals + 1), decimals, MidpointRoun原创 2011-11-24 21:36:58 · 287 阅读 · 0 评论 -
单元格回车焦点右移动
//单元格回车焦点右移动 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)//单元格回车焦点右移动 { if (keyData ==原创 2011-09-12 12:45:09 · 333 阅读 · 0 评论 -
焦点跳过只读列,直接跳到下一个焦点
//焦点跳过只读列,直接跳到下一个焦点 private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e) { if (this原创 2011-09-12 12:45:40 · 473 阅读 · 0 评论 -
ClassInputBox类 在c#中类似VB的InputBox
using System;using System.Collections.Generic;using System.Text;using System.Windows.Forms;#region 直接调用该类的静态ShowInputBox方法就可以实现Microsof原创 2011-09-12 12:48:31 · 887 阅读 · 0 评论 -
父子窗体的实现 基于panel
在mainForm中插入以下代码,并在mainForm中插入一个panel1登录 sAllPage = new 登录();sAllPage.Owner = this;sAllPage.FormBorderStyle = FormBorderStyle.None;sAll原创 2011-09-12 12:52:50 · 337 阅读 · 0 评论 -
父子窗体时使子窗体的DGV不默认选中
在用户控件中加载自动绑定后肯定是会选择第一行的,无论有没有焦点,ClearSelection()也不管用,只有在调用用户控件的地方才可以使ClearSelection()起作用;所以,可以将控制权从用户控件或者模式子窗体交给其调用者或者说交给父窗体,一下是方法delega转载 2011-10-03 21:43:33 · 417 阅读 · 0 评论 -
C# 读写 config.ini 文件
建立config.ini:;**********************************;**********************************[setting]companyName=******公司softName=******系统mo原创 2011-10-08 17:04:10 · 2461 阅读 · 0 评论 -
弹出式窗体的父子窗体刷新办法。
父窗体弹出窗体时的代码:窗体名称 Form = new 窗体名称();Form.MotherForm = this;Form.ShowDialog();子窗体的代码:父窗体名称 MotherForm;函数中:MotherForm= (父窗体名称)this.Owner;MotherForm.changeTab(1);原创 2011-10-01 20:07:13 · 290 阅读 · 0 评论