2008年6月3日

silverlight 2.0 实现拖动

摘要: using System; using System.Collections.Generic; using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using S... 阅读全文

posted @ 2008-06-03 17:14 leanco 阅读(739) 评论(0) 推荐(0)

2008年5月25日

scrollLeft,scrollWidth,clientWidth,offsetWidth之完全详解

摘要: scrollHeight: 获取对象的滚动高度。 scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离 scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离 scrollWidth:获取对象的滚动宽度 offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度 offsetLeft:... 阅读全文

posted @ 2008-05-25 15:02 leanco 阅读(148) 评论(0) 推荐(0)

2008年5月15日

排序算法

摘要: int[] max ={ 6, 5, 2, 9, 7, 4, 0 }; for (int i = 0; i < max.Length; i++) { for (int j = i + 1; j < max.Length; j++) { if (max[i] < max[j]) ... 阅读全文

posted @ 2008-05-15 16:40 leanco 阅读(90) 评论(0) 推荐(0)

输出Excel格式文件

摘要: string msg = "ccccccccccccc"; byte[] fileBuffer = new byte[8000]; char[] ch = msg.ToCharArray(); fileBuffer = System.Text.Encoding.Default.GetBytes(ch); Context.Respon... 阅读全文

posted @ 2008-05-15 16:39 leanco 阅读(144) 评论(0) 推荐(0)

日期与时间正则表达式

摘要: 这里是判断yyyy-mm-dd这种格式的,基本上把闰年和2月等的情况都考虑进去了, ^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d... 阅读全文

posted @ 2008-05-15 16:38 leanco 阅读(1016) 评论(0) 推荐(0)

清除两端空格

摘要: function Trim() { document.getElementById("TextBox1").value=document.getElementById("TextBox1").value.replace(/(^\s*)|(\s*$)/g, ""); } 阅读全文

posted @ 2008-05-15 16:38 leanco 阅读(104) 评论(0) 推荐(0)

弹出的窗口永远在屏幕右下角(WINFORM)

摘要: int x=0; int y=0; Form2 cp=new Form2(); if (Screen.AllScreens.Length > 0) { x = Screen.AllScreens[0].WorkingArea.Width - cp.Width; y = Screen.A... 阅读全文

posted @ 2008-05-15 16:37 leanco 阅读(483) 评论(0) 推荐(0)

永远只打开一个应用程序

摘要: using System; using System.Collections.Generic; using System.Windows.Forms; using System.Diagnostics; using System.Reflection; namespace Phone2007 { static class Program { /// ... 阅读全文

posted @ 2008-05-15 16:36 leanco 阅读(93) 评论(0) 推荐(0)

创建子项

摘要: var i=0; function addChild() { var newchild=document.createElement("div"); document.getElementById("di").appendChild(newchild); newchild.innerText="ok"; } 阅读全文

posted @ 2008-05-15 16:35 leanco 阅读(90) 评论(0) 推荐(0)

窗口自动上升

摘要: 主页: 窗口页:(NewForm.aspx) 阅读全文

posted @ 2008-05-15 16:34 leanco 阅读(95) 评论(0) 推荐(0)

导航