悟生慧

 

随笔分类 -  WinForm

上一页 1 2 3 4 5 下一页

C#使用方向键实现控件的移位
摘要:void textBox2_KeyDown(object sender,KeyEventArgs e) { Control ctr= (Control)sender; switch (e.KeyData) { case Keys.Right: if (ctr.Right == 0) { MessageBox.Show("已到顶"); } else ... 阅读全文

posted @ 2012-04-27 10:04 悟生慧 阅读(1750) 评论(0) 推荐(0) 编辑

WinFrom程序如何从数据库循环读取图片并合成
摘要:数据库中有表backgroundimage(背景图片表),backgroundpoint(图片坐标表),systemheadimage(头像表),分别存放的背景,坐标及头像,我现在要对应遍历出三表相关信息并合成一张图片,合成方法我已经做好,如下代码:C# code原文转自:http://club.itqun.net/showtopic-257319.htmlusing System;using System.Collections.Generic;using System.Text;using System.Drawing;using System.Drawing.Drawing2D;name 阅读全文

posted @ 2012-04-26 18:14 悟生慧 阅读(692) 评论(1) 推荐(0) 编辑

winfrom中简单引用WebService
摘要:新建工程中有两个项目一个是Web服务应用程序 如TestWebService 另一个是WinForm应用程序 如TestFormusing System;using System.Collections;using System.ComponentModel;using System.Data;using System.Linq;using System.Web;using System.Web.Services;using System.Web.Services.Protocols;using System.Xml.Linq;namespace TestWebService{ /// ... 阅读全文

posted @ 2012-04-26 17:44 悟生慧 阅读(1141) 评论(0) 推荐(0) 编辑

C#读取数据库返回泛型集合 把DataSet类型转换为List<T>泛型集合
摘要:/// <summary> /// 获取UserInfo泛型集合 /// </summary> /// <param name="connStr">数据库连接字符串</param> /// <param name="sqlStr">要查询的T-SQL</param> /// <returns></returns> public IList<UserInfo> GetUserInfoAll(string connStr, string sqlStr) 阅读全文

posted @ 2012-04-26 17:18 悟生慧 阅读(13272) 评论(0) 推荐(1) 编辑

winfrom的右击菜单项事件中如何获取关联控件的引用
摘要:private void toolStripMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem tsi = (ToolStripMenuItem)sender;//转换类型 ContextMenuStrip strip = tsi.GetCurrentParent() as ContextMenuStrip;//检索作为当前ToolStripItem的容器 Control c = strip.SourceControl;//获取使Co... 阅读全文

posted @ 2012-04-17 10:38 悟生慧 阅读(1097) 评论(0) 推荐(0) 编辑

c# 如何用SplitContainer将From分割成上下两部分 即纵向分割窗口
摘要:控制 SplitContainer 是横向分割窗体还是纵向分割窗口是由 SplitContainer 的 Orientation 属性决定的。this.splitContainer1.Orientation=Orientation.Horizontal;this.splitContainer1.Orientation = Orientation.Vertical; 阅读全文

posted @ 2012-04-13 10:51 悟生慧 阅读(14791) 评论(0) 推荐(1) 编辑

C# WinForm的PictureBox控件图片的拉伸或收缩方式跟随着控件的大小
摘要:图片填充整个PictureBox只需要设置属性pictureBox.SizeMode = PictureBoxSizeMode.StretchImage; 阅读全文

posted @ 2012-04-06 12:07 悟生慧 阅读(17736) 评论(0) 推荐(0) 编辑

C# winfrom动态加载TreeView控件
摘要:如果需要给TreeNode绑定自己想要的属性解决办法? 自定义TreeNode 继承自.net的TreeNode后 添加属性如: public class CustomTrNode : TreeNode { /// <summary> /// 属性1:控件类型 /// </summary> public object ControlType { get; set; } /// <summary> /// 属性2:父ID /// </summary> public object ParentID { get; set; } }在 NodeMouse 阅读全文

posted @ 2012-03-29 16:54 悟生慧 阅读(4683) 评论(0) 推荐(1) 编辑

Winfrom 控件移位绘制垂直、水平线
摘要:public delegate void XMatchEventHandler(int x,bool flags);//定义委托private int x; ///窗体加载 private void Form1_Load(object sender, EventArgs e) { XObject.p = this.panel1; MatchListener ml = new MatchListener(); ml.XMatch += new MatchListener.XMatchEventHandler(ml_XMatch); ThreadStart ts = new ThreadStar. 阅读全文

posted @ 2012-03-13 16:15 悟生慧 阅读(646) 评论(0) 推荐(0) 编辑

C#控件及常用属性整理
摘要:转自:http://www.diybl.com/course/3_program/cshapo/csharpjs/20100714/441408.htmlC#控件一览表 前所未有的震撼(太详细了) 1、窗体 1、常用属性 (1)Name属性:用来获取或设置窗体的名称,在应用程序中可通过Name属性来引用窗体。 (2) WindowState属性: 用来获取或设置窗体的窗口状态。 取值有三种: Normal (窗体正常显示)、 Minimized(窗体以最小化形式显示)和 Maximized(窗体以最大化形式显示)。 (3)StartPosition属性:用来获取或设置运行时窗体的起始位置。(4 阅读全文

posted @ 2012-03-10 11:48 悟生慧 阅读(8599) 评论(0) 推荐(1) 编辑

“无法在证书存储区中找到清单签名证书”错误的解决方法
摘要:今天遇到这么个问题,打开WinForm项目编译时报出“无法在证书存储区中找到清单签名证书”错误的解决方法”这样的错。在园子里逛了圈找到一篇,如下:转载自:http://www.cnblogs.com/sailxc/archive/2011/10/20/2219246.html方法一:在VS2005中出现该错误时,用记事本打开项目的.csproj文件,删除以下内容即可: <ManifestCertificateThumbprint>B531F2CF222748C5E29308FC2247704827D1EA8C</ManifestCertificateThumbprint> 阅读全文

posted @ 2012-03-09 09:46 悟生慧 阅读(356) 评论(0) 推荐(0) 编辑

模仿office的控件
摘要:http://www.codeproject.com/Articles/25907/A-Professional-Ribbon-You-Will-Use-Now-with-orbRibbon 控件C# WinForm开发系列 - CheckBox/Button/Label/ProgressBar 阅读全文

posted @ 2012-03-05 15:05 悟生慧 阅读(383) 评论(0) 推荐(0) 编辑

winform界面设计
摘要:转载自:http://spirit---moon.blog.163.com/blog/static/213231462010014114851785/一,不规则WINFORM窗体Author:unknown From:Internet在以前版本的Visual Basic或Visual C++中,创建不规则窗体和控件是一件很复杂的事,不仅需要调用大量API函数而且工作量也不小。不过,现在在Visual C#下,情况就完全不同了。运用Windows Forms你就可以很轻易地创建出一个不规则的窗体以及窗体上的控件。一个具有不规则窗体和控件的应用程序肯定会更吸引广大的用户,微软的Windows Me 阅读全文

posted @ 2012-03-05 11:33 悟生慧 阅读(943) 评论(0) 推荐(0) 编辑

DataGridView列右击菜单事件
摘要:教程:http://technet.microsoft.com/zh-cn/library/system.windows.forms.datagridviewcellcontextmenustripneededeventhandler(v=VS.85).aspxDGV上的鼠标事件,MouseDown 、MouseUp、CellMouseClick等事件可参考。 if (MouseButtons == MouseButtons.Right) MessageBox.Show("OK"); // DataGridView 的 ContextMenuStrip 设定 DataGri 阅读全文

posted @ 2012-02-27 18:14 悟生慧 阅读(3897) 评论(0) 推荐(0) 编辑

如何实现控件从IDE拖放到窗体上的效果?
摘要:在http://www.icsharpcode.net/OpenSource/SD/上看看sharpdevelop,这是一款开源的IDE下载路径:http://sourceforge.net/projects/sharpdevelop/files/SharpDevelop%204.x/4.1/SharpDevelop_4.1.0.8000_Source.zip/download?use_mirror=iweb 阅读全文

posted @ 2012-01-05 13:28 悟生慧 阅读(327) 评论(0) 推荐(0) 编辑

c#windows 应用程序picturebox形状怎样变成圆形
摘要:using System.Drawing.Drawing2D; private void button1_Click(object sender, EventArgs e) { GraphicsPath gp = new GraphicsPath(); gp.AddEllipse(pictureBox1.ClientRectangle); Region region = new Region(gp); pictureBox1.Region = region; pictureBox2.Region=region; pictureBox3.Region=region; gp.Dispose();. 阅读全文

posted @ 2012-01-05 09:23 悟生慧 阅读(7916) 评论(0) 推荐(1) 编辑

C#.Net 中枚举类型的数据在PropertyGrid控件中的显示中文描述
摘要:http://www.cnblogs.com/michaellu/articles/1226431.html原文摘要:在程序设计过程中经常会遇到一些数据是以枚举值的形式提供给用户进行选择或查看,通常情况下,枚举数据都是已英文的方式或者便于程序中使用的方式来设置的。在显示枚举类型的数据是又通常是使用ToString()的方式将枚举数据显示出来,在通过PropertyGrid显示给用户时感觉不是很友好,很多用户希望能够以中文的方式显示出来。本文就以实例的方式介绍如何在程序中实现PropertyGrid中友好显示的方式,而又不影响Enum类型的数据在其他地方的使用。一、引文 PropertyGrid 阅读全文

posted @ 2011-12-21 12:21 悟生慧 阅读(3122) 评论(0) 推荐(0) 编辑

C#利用KeyValuePair实现Dictionary的遍历方法
摘要:public class Class1 { public string Name; public int Age; public Class1(string name, int age) { this.Name = name; this.Age = age; } } private void button2_Click(object sender, EventArgs e) { Dictionary<string, Class1> cl = new Dictionary<string, Class1>(); Class1 s1 = new Class1("张三 阅读全文

posted @ 2011-12-16 14:53 悟生慧 阅读(8139) 评论(4) 推荐(0) 编辑

vs2008 此安装不支持该项目类型
摘要:下载dotnetfx35setu.exe/Files/chaobaojun/AspNetMVC1.rarp文件。然后下载AspNetMVC1.msi/Files/chaobaojun/dotnetfx35setup1.rar安装下都可以用了!原文转自:http://www.cnblogs.com/chaobaojun/archive/2009/11/27/1612287.html 阅读全文

posted @ 2011-12-14 10:39 悟生慧 阅读(269) 评论(0) 推荐(0) 编辑

怎么在DataGridView中动态添加DateTimePicker列?
摘要:using System;using System.Windows.Forms;namespace MasterSoft.WinUI{ ///<summary> /// DataGridView 中的日历列 ///</summary> ///<example > /// DataGridViewCalendarColumn ordBillSubConsignmentDateDataGridViewCalendarColumn = new DataGridViewCalendarColumn(); /// ordBillSubConsignmentDateDa 阅读全文

posted @ 2011-12-07 16:21 悟生慧 阅读(1880) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 下一页

导航