williambirkin

恭喜发财!

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

05 2007 档案

摘要:编写环境VS20051.PIPAddress 参考网上的例子(API实现方式)实现上还是有问题。在设计界面中将控件拖到窗体中时会报错说什么东西没有实例化,并且导致VS失去响应,CPU资源被VS的进程100占用。试了很久不清楚是什么问题。欢迎高手指点。但是如果使用代码动态添加控件到窗体中,则不会有任何问题。2.UCIPAddress 自己写的UserControl控件实现上比较简单,都是些傻办法。不... 阅读全文
posted @ 2007-05-11 16:57 williambirkin 阅读(609) 评论(2) 推荐(0)

摘要:1. Windows Forms中禁用窗体的关闭按钮 添加必要的命名空间: using System.Runtime.InteropServices; 添加必要的常数和API函数的引用 private const int SC_CLOSE = 0xF060; private const int MF_ENABLED = 0x00000000; private const int MF_GRAYED... 阅读全文
posted @ 2007-05-10 13:25 williambirkin 阅读(512) 评论(0) 推荐(0)

摘要:回车移动焦点1.普通控件(TextBox)(最好在父窗体中实现以下代码,然后子窗体继承父窗体实现该功能)①Form.KeyPreview属性设为True②在KeyPress事件中添加以下代码private void BaseForm_KeyPress(object sender, KeyPressEventArgs e){ if (e.KeyChar == (char)Keys.Return... 阅读全文
posted @ 2007-05-10 12:16 williambirkin 阅读(1085) 评论(2) 推荐(0)

摘要:测试代码如下: 测试代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System;using System.Collections.Generic;using System.ComponentModel;using System.Dat... 阅读全文
posted @ 2007-05-09 14:28 williambirkin 阅读(989) 评论(0) 推荐(0)

摘要:nud_print_number.BackColor = System.Drawing.SystemColors.Control; 阅读全文
posted @ 2007-05-08 16:16 williambirkin 阅读(249) 评论(0) 推荐(0)

摘要:自定义单元格验证 要求: 验证错误后焦点不离开。 实现: 单元格的验证可以使用dgv_details_CellValidating事件。 验证不通过时调用e.Cancel = true;终止事件链,单元格将保持编辑状态。 调用dgv_details.CancelEdit();可以使单元格的内容会滚到修改前的值。 使用System.Windows.Forms.SendKeys.Send("^a");... 阅读全文
posted @ 2007-05-08 16:15 williambirkin 阅读(1676) 评论(1) 推荐(0)