随笔分类 -  C#

摘要:把列的ColumnEdit属性设置为RepositoryItemButtonEdit 把TextEditStyle属性设置为HideTextEditor; 把Buttons的Kind属性设置为Glyph; 把Button的Caption用于设置文字 把Buttons的TextOpti... 阅读全文
posted @ 2014-08-10 17:37 走路到纽约 阅读(2474) 评论(0) 推荐(0)
摘要:下面给一个简单的例子,至于多个单元格合并,请自己去实现,也就是坐标计算的事情。至于画图,用GDI,还是DirectX画,自己选择,不过这里主要讲的是算法:坐标计算以及画的过程。注意不要每个列都画一个矩形,很浪费的,因为都重叠了。using System;using System.Drawing;us... 阅读全文
posted @ 2014-05-26 23:58 走路到纽约 阅读(8731) 评论(0) 推荐(0)
摘要:1.在ASPX页面下加一个隐藏域 <asp:HiddenField ID="HidSign" runat="server" />2.cs代码 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { UpdateSign(); } } static string rp_GoodsEdit; public void UpdateSign() ... 阅读全文
posted @ 2011-12-27 18:36 走路到纽约 阅读(722) 评论(0) 推荐(0)
摘要:效果如下图,表头13-1 到13-11 也是动态绑定的。 protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { TableCellCollection tcHeader = e.Row.Cells;//获取表头行的所有单元 tcHeader.Clear();//清空原有的表头信... 阅读全文
posted @ 2011-12-27 17:21 走路到纽约 阅读(1679) 评论(0) 推荐(0)
摘要:using System.Diagnostics; Stopwatch st = new Stopwatch(); st.Start(); st.Stop(); long timeCount = st.ElapsedMilliseconds; st.Reset(); 阅读全文
posted @ 2011-11-02 17:44 走路到纽约 阅读(364) 评论(0) 推荐(0)
摘要:http://www.cnblogs.com/legend_sun/archive/2008/12/23/1360533.html#Convert.ToInt32、int.Parse(Int32.Parse)、int.TryParse、(int) 四者都可以解释为将类型转换为 int,那它们的区别是什么呢?Convert.ToInt32 与 int.Parse 较为类似,实际上 Convert.ToInt32内部调用了 int.Parse:Convert.ToInt32 参数为 null 时,返回 0; int.Parse 参数为 null 时,抛出异常。 Convert.ToInt32 参数 阅读全文
posted @ 2011-06-02 13:55 走路到纽约 阅读(235) 评论(0) 推荐(0)
摘要:接口namespace Calculator{ public interface Iwel { String Print(); }}类namespace Calculator{ public class Arithmetic:Iwel { /// <summary> /// 没有带参数的构造函数 /// </summary> public Arithmetic() {} public Arithmetic(int num1, int num2) { _num1 = num1; _num2 = num2; } private int _num1; public int N 阅读全文
posted @ 2011-05-15 10:32 走路到纽约 阅读(1573) 评论(1) 推荐(2)
摘要:1、ref是传递参数的地址,out是返回值,两者有一定的相同之处,也有不同点2、使用ref前必须对变量赋值,out不用3、out的函数会清空变量,即使变量已经赋值也不行,退出函数时所有out引用的变量都要赋值,ref引用的可以修改,也可以不修改。 阅读全文
posted @ 2011-03-23 08:49 走路到纽约 阅读(254) 评论(0) 推荐(0)