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

2013年2月21日

摘要: 判断同一程序不能同时启动两个应用的代码:在Program中加入如下判断: bool bRun = true; System.Threading.Mutex m = new System.Threading.Mutex(true, Application.ProductName, out bRun); if (bRun) { Application.EnableVisualStyles(); Application.SetCompatibleText... 阅读全文

posted @ 2013-02-21 15:25 JmrBrvae 阅读(312) 评论(0) 推荐(0) 编辑

2013年2月5日

摘要: 最近,在做一个统计系统,需要用到柱状图和线形图。之前没有接触过这个控件,不过经过从网上搜索,还是能搜到很多的示例,那么在这在自己总结一下。下面是最基本的创建图形的代码: Series s = new Series("语文", ViewType.Bar); Series s1 = new Series("数学", ViewType.Bar); SeriesPoint sp = new SeriesPoint("第一学期", new double[] { 100}); SeriesPoint sp1 = new... 阅读全文

posted @ 2013-02-05 16:11 JmrBrvae 阅读(963) 评论(4) 推荐(0) 编辑

2013年1月7日

摘要: 因为项目要保存本地化配置 我用Xml保存的,所以要把背景色 字体设置转换成字符串Color与String之间的转换 string colorValue = ColorTranslator.ToHtml(Color.Red); Color c = ColorTranslator.FromHtml(colorValue);Font与String之间的转换FontDialog fd = new FontDialog(); fd.ShowDialog(); FontConverter fcs = new FontConverter();... 阅读全文

posted @ 2013-01-07 10:37 JmrBrvae 阅读(497) 评论(0) 推荐(0) 编辑

2012年12月12日

摘要: 最近做了asp.net的局部打印,开始是想用报表的,可总是感觉不如自定义页面灵活。那么就来说说asp.net页面局部打印是如何实现的。 <script type="text/javascript"> var hkey_root, hkey_path, hkey_key; hkey_root = "HKEY_CURRENT_USER"; hkey_path = "\\Software\\Microsoft\\Internet Explorer\\PageSetup\\"; //去掉页眉页脚的方法 function pages 阅读全文

posted @ 2012-12-12 14:23 JmrBrvae 阅读(811) 评论(0) 推荐(0) 编辑

2012年11月28日

摘要: http://www.my97.net/ 下载地址 里面有实例 很灵活 很好用! 阅读全文

posted @ 2012-11-28 13:40 JmrBrvae 阅读(186) 评论(0) 推荐(0) 编辑

摘要: 在Gridview的rowdatabind事件中添加如下代码:protected void GVData_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowIndex > -1) { //循环每列 判断需要添加打开新窗体脚本的列 如果改行任意位置都能打开新窗体 则 直接执行if内代码 将cell改为e.Row foreach (TableCell cell in e.Row.Cells) { ... 阅读全文

posted @ 2012-11-28 10:13 JmrBrvae 阅读(438) 评论(0) 推荐(0) 编辑

2012年11月26日

摘要: 很久没做WEB,今天遇得到了一些问题,在此记录一下。首先,在gridview的rowdataBind事件中添加如下代码 foreach (GridViewRow dvr in GVData.Rows) { Button b1 = (Button)GVData.Rows[dvr.RowIndex].Cells[11].FindControl("Button4"); b1.CommandArgument = dvr.RowIndex.ToString(); } 将行索引赋值给Button的CommandArgument属性。... 阅读全文

posted @ 2012-11-26 14:51 JmrBrvae 阅读(472) 评论(0) 推荐(0) 编辑

2012年11月9日

摘要: 有个项目,需要在datagridview的单元格里加右键菜单,进行数据操作。最开始用的代码是:private void dataGridView1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex >=0) { if (e.Button == MouseButtons.Right) { dataGridView1.ClearSelection(); ... 阅读全文

posted @ 2012-11-09 16:25 JmrBrvae 阅读(904) 评论(0) 推荐(1) 编辑

2012年11月8日

摘要: 自己本身对多线程不是很了解,前段时间做项目,图像识别模块需要用得到多线程,将识别的结果显示在列表中Thread th = new Thread(new ThreadStart(GetImgString)); Control.CheckForIllegalCrossThreadCalls = false; th.Start(); GetImgString() 方法中包含了识别过程以及数据处理,最后将数据绑定到datagridview最开始 我直接给dataSource赋值 但是每当执行到第三次的时候就会报一个空指针的异常从网上查阅后,然后将绑定方法改成了下面的代码:dataGridView1.. 阅读全文

posted @ 2012-11-08 15:21 JmrBrvae 阅读(1106) 评论(0) 推荐(0) 编辑

2012年11月5日

摘要: 前段时间开发遇到了一些问题,在此记录一下。 //获取选中单元格的值 dataGridView1.CurrentCell.Value.ToString(); //获取选中单元格的索引值 int indexNo = dataGridView1.CurrentCell.ColumnIndex; //获取选中单元格的列的表头值 string headerText=dataGridView1.Columns[dataGridView1.CurrentCell.ColumnI... 阅读全文

posted @ 2012-11-05 10:31 JmrBrvae 阅读(231) 评论(0) 推荐(0) 编辑