摘要:void textBox2_KeyDown(object sender,KeyEventArgs e) { Control ctr= (Control)sender; switch (e.KeyData) { case Keys.Right: if (ctr.Right == 0) { MessageBox.Show("已到顶"); } else ...
阅读全文
摘要:数据库中有表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
阅读全文
摘要:新建工程中有两个项目一个是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{ /// ...
阅读全文
摘要:/// <summary> /// 获取UserInfo泛型集合 /// </summary> /// <param name="connStr">数据库连接字符串</param> /// <param name="sqlStr">要查询的T-SQL</param> /// <returns></returns> public IList<UserInfo> GetUserInfoAll(string connStr, string sqlStr)
阅读全文
摘要:private void toolStripMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem tsi = (ToolStripMenuItem)sender;//转换类型 ContextMenuStrip strip = tsi.GetCurrentParent() as ContextMenuStrip;//检索作为当前ToolStripItem的容器 Control c = strip.SourceControl;//获取使Co...
阅读全文
摘要:控制 SplitContainer 是横向分割窗体还是纵向分割窗口是由 SplitContainer 的 Orientation 属性决定的。this.splitContainer1.Orientation=Orientation.Horizontal;this.splitContainer1.Orientation = Orientation.Vertical;
阅读全文
摘要:图片填充整个PictureBox只需要设置属性pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
阅读全文
摘要:如果需要给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
阅读全文
摘要: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.
阅读全文
摘要:转自: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
阅读全文
摘要:今天遇到这么个问题,打开WinForm项目编译时报出“无法在证书存储区中找到清单签名证书”错误的解决方法”这样的错。在园子里逛了圈找到一篇,如下:转载自:http://www.cnblogs.com/sailxc/archive/2011/10/20/2219246.html方法一:在VS2005中出现该错误时,用记事本打开项目的.csproj文件,删除以下内容即可: <ManifestCertificateThumbprint>B531F2CF222748C5E29308FC2247704827D1EA8C</ManifestCertificateThumbprint>
阅读全文
摘要:http://www.codeproject.com/Articles/25907/A-Professional-Ribbon-You-Will-Use-Now-with-orbRibbon 控件C# WinForm开发系列 - CheckBox/Button/Label/ProgressBar
阅读全文
摘要:转载自: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
阅读全文
摘要:教程: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
阅读全文
摘要:在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
阅读全文
摘要: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();.
阅读全文
摘要:http://www.cnblogs.com/michaellu/articles/1226431.html原文摘要:在程序设计过程中经常会遇到一些数据是以枚举值的形式提供给用户进行选择或查看,通常情况下,枚举数据都是已英文的方式或者便于程序中使用的方式来设置的。在显示枚举类型的数据是又通常是使用ToString()的方式将枚举数据显示出来,在通过PropertyGrid显示给用户时感觉不是很友好,很多用户希望能够以中文的方式显示出来。本文就以实例的方式介绍如何在程序中实现PropertyGrid中友好显示的方式,而又不影响Enum类型的数据在其他地方的使用。一、引文 PropertyGrid
阅读全文
摘要: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("张三
阅读全文
摘要:下载dotnetfx35setu.exe/Files/chaobaojun/AspNetMVC1.rarp文件。然后下载AspNetMVC1.msi/Files/chaobaojun/dotnetfx35setup1.rar安装下都可以用了!原文转自:http://www.cnblogs.com/chaobaojun/archive/2009/11/27/1612287.html
阅读全文
摘要:using System;using System.Windows.Forms;namespace MasterSoft.WinUI{ ///<summary> /// DataGridView 中的日历列 ///</summary> ///<example > /// DataGridViewCalendarColumn ordBillSubConsignmentDateDataGridViewCalendarColumn = new DataGridViewCalendarColumn(); /// ordBillSubConsignmentDateDa
阅读全文