摘要: 需求:在点击主导航栏,弹出contextMenuStrip控件时,将其出现位置固定解决:1、让Winform程序contextMenuStrip控件跟随鼠标位置出现代码:contextMenuStrip1.Show(Control.MousePosition.X, Control.MousePosition.Y); contextMenuStrip1.Show(MousePosition);2、让Winform程序contextMenuStrip控件出现在固定位置代码: contextMenuStrip1.Location = new Point(this.Location... 阅读全文
posted @ 2012-07-31 18:13 黑白 阅读(366) 评论(0) 推荐(0)
摘要: 在.NET的WinForm中调用Web Service的操作基本上和在ASP.NET中调用Web Service是一样。首先在项目上单击鼠标右键,在弹出的快捷菜单中选择“添加Web引用”命令,如图7-11所示。添加完引用后,项目中也会创建一个名叫Web References的目录,即引用代理类,如图7-12所示。图7-11 添加Web引用 图7-12 Web引用代理类代码中使用这个代理类进行调用。ProductService.LTPService service = new ProductService.LTPService();string price=service.GetProductP 阅读全文
posted @ 2012-07-03 10:27 黑白 阅读(210) 评论(0) 推荐(0)
摘要: //MD5加密方式。 string str = "0.0"; byte[] result = Encoding.Default.GetBytes(str); MD5 md5 = new MD5CryptoServiceProvider(); byte[] output = md5.ComputeHash(result); MessageBox.Show(BitConverter.ToString(output).Replace("-", "")); 阅读全文
posted @ 2012-06-29 16:57 黑白 阅读(128) 评论(0) 推荐(0)
摘要: publicvoidSetWindowRegion(){System.Drawing.Drawing2D.GraphicsPathFormPath;FormPath=newSystem.Drawing.Drawing2D.GraphicsPath();Rectanglerect=newRectangle(0,22,this.Width,this.Height-22);//this.Left-10,this.Top-10,this.Width-10,this.Height-10);FormPath=GetRoundedRectPath(rect,30);this.Region=newRegion 阅读全文
posted @ 2012-06-29 12:57 黑白 阅读(645) 评论(0) 推荐(1)
摘要: 最简单的,只显示提示[ti shi]信息。 2. MessageBox .Show("There are something wrong!" ,"ERROR" ); 可以给消息框加上标[shang biao]题。 3. if (MessageBox .Show("Delete this user?" , "Confirm Message" , MessageBoxButtons .OKCancel) == DialogResult .OK) { //delete } 询问是否删除[shan chu]时会用到这个。 阅读全文
posted @ 2012-05-24 17:26 黑白 阅读(505) 评论(0) 推荐(0)
摘要: 面对人生第一道坎,自己一定要慎重。面对人生第一道坎,自己一定要执着。面对人生第一道坎,自己一定要自信。面对人生第一道坎,自己一定要有魄力。面对人生第一道坎,自己一定要坚强。加油! 阅读全文
posted @ 2012-04-06 15:08 黑白 阅读(126) 评论(0) 推荐(0)