上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 33 下一页
摘要: 首先,需要向项目中的reference添加两个dll,一个是.NET库中的 System.Windows.Forms,另外一个是WindowsFormsIntegration,它的位置一般是在C:\Windows \Microsoft.NET\Framework\v4.0.30319\WPF 里。添加完两个dll以后,就可以在控件库中找到WindowsFormsHost这个控件了。这个控件是我们添加Windows Form控件的基础。跟别的其他的控件一样,它也是可控的,可以自定义它在窗口中的位置、控件大小颜色等属性。我一般是比较喜欢在Blend里面创建控 件。可以在Blend中的Assets中 阅读全文
posted @ 2013-05-03 12:51 金虹巴巴 阅读(411) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2013-05-03 11:49 金虹巴巴 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 问题描述:Office 打印时,引用了Microsoft.Office.Interop.Excel Excel.Application xlsApp = new Excel.Application(); xlsApp.Visible = true; Excel.Workbooks xlsWbs = xlsApp.Workbooks; Excel.Workbook xlsWb = xlsWbs.Open();//省略参数 Excel.Worksheet xlsWs = (Excel.Worksheet)xlsWb.Worksheets[1];执行到Excel.Worksheet xlsWs = 阅读全文
posted @ 2013-05-02 13:32 金虹巴巴 阅读(3183) 评论(0) 推荐(0) 编辑
摘要: 1.只是显示图片string path =相对路径 path =绝对路径BitmapImage image = new BitmapImage(new Uri(path, UriKind.Absolute));img.Source = image;2.在另一段代码中,要删除这个图片就需要先把图片转换成文件流,在当前读取流完时,关闭流,当要删除图片时释放资源,修改代码如下:System.IO.FileStream m_ImageStream;string path;string path =相对路径path =绝对路径BitmapImage image = new BitmapImage();m 阅读全文
posted @ 2013-04-28 17:26 金虹巴巴 阅读(428) 评论(0) 推荐(0) 编辑
摘要: 我还一直以为这玩艺用不了的,今天听同事说可以,看了下发现了问题。首先,这个服务器上必须的安装EXCEL。第二,这个路径必须的是服务器上的路径,比方你直接查自己电脑上的就必须的用本机的SQL服务器。我用的一句:select * From openrowset('Microsoft.JET.OLEDB.4.0','Excel 8.0;DATABASE=D:\CrystalReportViewer1.xls','select * from[sheet1$A1:D100]')还可以指定A1-D1 的前100行,当然第一列作了列名的话只有99了。2007和 阅读全文
posted @ 2013-04-26 20:59 金虹巴巴 阅读(206) 评论(0) 推荐(0) 编辑
摘要: public DataTable ToDataTable(DataRow[] rows) { if (rows == null || rows.Length == 0) return null; DataTable tmp = rows[0].Table.Clone(); // 复制DataRow的表结构 foreach (DataRow row in rows) tmp.Rows.Add(row); // 将DataRow添加到DataTable中 return tmp; }////////////... 阅读全文
posted @ 2013-04-26 16:36 金虹巴巴 阅读(1074) 评论(0) 推荐(0) 编辑
摘要: 定义多个Listbox,可以实现相互拖动,如listbox1,listbox2,设置如下allowdrop=true和this.listBox2.DragDrop += new System.Windows.Forms.DragEventHandler(this.ListBox1_DragDrop); this.listBox2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ListBox1_MouseDown); this.listBox2.DragOver += new System.Windows.Forms.D 阅读全文
posted @ 2013-04-26 09:41 金虹巴巴 阅读(4295) 评论(0) 推荐(0) 编辑
摘要: ///<summary>///上移///</summary>///<paramname="sender"></param>///<paramname="e"></param>privatevoidtsbMoveUp_Click(objectsender,EventArgse){if(Tv_tree.SelectedNode==null){MessageBox.Show("请选择需要移动的的节点!");this.Focus();return;}foldermodel 阅读全文
posted @ 2013-04-23 11:15 金虹巴巴 阅读(1044) 评论(0) 推荐(0) 编辑
摘要: 现有装满Customer对象的List<Customer>一个,Customer里面有一属性orderID 是数字现在想根据Customer.orderID将List<Customer>排序 请问要怎么做?如果你用的是3.5的framework,用lamda表达式就可以实现,很简单。假设这里开始构建list:List<Customer> list=new List<Customer>();list.add();.......--------这里进行排序-----------list.Sort((customer1, customer2) => 阅读全文
posted @ 2013-04-18 13:15 金虹巴巴 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 首先我必须承认访问一个类的私有成员不是什么好做法。大家也都知道私有成员在外部是不能被访问的。而一个类中会存在很多私有成员:如私有字段、私有属性、私有方法。对于私有成员访问,可以套用下面这种非常好的方式去解决。private string name;public string Name{ get { return name; } set { name = value; }} 但是有时候,源代码是别人的,你就不能修改源代码,只提供给你dll。或者你去维护别人的代码,源代码却有丢失。这样的情况如果你想知道私有成员的值,甚 至去想直接调... 阅读全文
posted @ 2013-04-12 10:59 金虹巴巴 阅读(285) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 33 下一页