![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c#
文章平均质量分 69
ytbada
这个作者很懒,什么都没留下…
展开
-
圆角窗体
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { GraphicsPath shape=new GraphicsPath(); int a=40; int w=this.Width-a; int h=this.Height-原创 2007-01-09 16:10:00 · 598 阅读 · 0 评论 -
叶落归根(纯技术)
2006/6/27效率最好的排序方法Sort(int a[],int left,int right){ int value,l,r,temp; l=left; r=right; value = a[(left+right)/2]; while(l { while(a[l] l++; while(a[r]>value)原创 2007-01-15 21:05:00 · 4129 阅读 · 0 评论 -
How to write your own custom Form
From: Sebastian Mark - view profile Date: Fri, Nov 12 2004 3:18 am原创 2007-01-15 21:49:00 · 892 阅读 · 0 评论 -
How do I add a ProgressBar to a .NET StatusBar
How do I add a ProgressBar to a .NET StatusBar?You can add a ProgressBar to a panel on your .NET StatusBar control by subclassing the StatusBar. Then you use the derived StatusBar on your WinForm ju原创 2007-01-15 23:12:00 · 756 阅读 · 0 评论 -
不想做复合控件,想在文本框里加个按钮
我自己的想法是这样子。 控件上有一个属性设置为是的时候,当我在选定文本框为输入焦点的时候,里面最右边能显示一个可以有单击事件的小按钮。如果文本框失去焦点则按钮消失,同时单击事件不被激发。 如果控件的这个属性设置为否,则与普通文本框没有区别。 我自己做了一个,但是它总是不能显示出来那个按钮。 1楼 mark 2楼 L原创 2007-01-17 17:14:00 · 1009 阅读 · 0 评论 -
试图在没有边框的文本框下划一条线可是有问题
代码如下 1 this.SetStyle(ControlStyles.DoubleBuffer,true); 2 const int WM_NCPAINT = 0x0085; protected override void WndProc(ref Message m)原创 2007-01-17 17:17:00 · 1318 阅读 · 0 评论 -
How to stretch a background image of a windows form
Hello,I write a windows form using C# with a background image on it. When itsrunning on US English Windows, everything is fine. When its running onChinese Windows, the原创 2007-01-18 11:40:00 · 1045 阅读 · 0 评论 -
c# 几个基本的问题--估计认真学过的可以解答
晕死 属性 FormBorderStyle = None 标题栏和边框就都没了 这些都没了还怎么拖动 class form1 : Forms { public 数据类型 XXX; private void Fun() { form2 frm = new form2(this); frm.show(); frm.Dispose(); } ... } class form2 : Forms { Fo原创 2007-01-24 10:35:00 · 537 阅读 · 0 评论 -
用鼠标调整没有边框的窗体
这里的代码是一个用来模拟用鼠标调整一个窗口的大小或位置的,有意思啊,是俺的生用MSDN查出来的,觉得好用好玩,拿来和大家共享下,希望高人指点,以改进程序.using System;using System.Drawing;using System.Windows.Forms;namespace MoveControlLocation{ /// /// FormBase 的摘要说明。 //原创 2007-01-24 10:38:00 · 659 阅读 · 0 评论 -
用C#实现在客户区拖动窗体
soft Windows Media Player。Media Player有项功能是根据用户的爱好可以随意换掉外观(换肤),这个时候标题栏就隐藏了,但是你能够通过客户区来拖动窗体。 好了,言归正传,开始我们的旅程吧 首先必须了解Windows的消息传递机制,当有鼠标活动消息时,系统发送WM_NCHITTEST 消息给窗体作为判断消息发生地的根据。假如你点击的是标题栏,窗体收到的消息值就是 HTC原创 2007-01-24 20:45:00 · 1134 阅读 · 0 评论 -
Adding a shadow around panel
Found the following interesting discussion in the Newsgroups: Adding a shadow around panelby:Lasse Eskildsen Hi,I have a panel on my原创 2007-01-22 10:36:00 · 767 阅读 · 0 评论 -
winapi stuct
[Mono-patches] mcs/class/System.Windows.Forms/System.Windows.Forms ChangeLog,1.65,1.66 win32functions.cs,1.1,1.2 win32Structs.cs,1.1,1.2 Menu.cs,1.16,1.17 ScrollableControl.cs,1.8,1.9 NativeWindow.cs,原创 2007-01-22 14:30:00 · 1565 阅读 · 0 评论 -
使用.NET访问 Internet(1)
原创 2007-03-16 11:22:00 · 882 阅读 · 0 评论 -
C#中代码Dialog控件实现(打开,保存,改变字体,颜色,打印功能)
打开:private void openFileDialogBTN_Click(object sender, System.EventArgs e){OpenFileDialog openFileDialog=new OpenFileDialog();openFileDialog.InitialDirectory="c://";//注意这里写路径时要用c://而不是c:openFileDi原创 2007-04-06 08:46:00 · 1759 阅读 · 1 评论 -
Disabling Copy/Paste in a Textbox control in C#
Hi, I have a user control that pops up much like intelisense in visual studio to display a range of navigable options when a key combo is pressed within a textbox. I have called the user contro原创 2007-01-15 23:26:00 · 1015 阅读 · 0 评论 -
C#WinForm制作异形窗体/控件
制作异形窗体或控件的思路一般都是想办法生成一个region,然后设置给指定的窗口或控件。生成region的方法有很多,最常用的就是从一幅图片生成,把该图片中的透明色部分“抠”掉,剩下的部分作为一个region。设置窗口或控件的region可以用SetWindowRgn API,不过.NET framework封装了这个操作,在C#中只要对窗口或控件的Region属性赋值就可以了。下面我就把我在C#原创 2007-01-15 22:20:00 · 1274 阅读 · 1 评论 -
sendmessage全力打造无标题栏如有标题栏(C#)
using System.Runtime.InteropServices;[DllImportAttribute("user32.dll")]public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);//发送消息//winuser.h 中有函数原型定义[DllImportAttribut原创 2007-01-10 16:28:00 · 1580 阅读 · 1 评论 -
有用的WndProc(ref Message m)方法
在Windows操作中,所有的操作都是基于消息的。 我们编写的程序,也是这个道理。同样,我们也可能查看事件发生时,到底触发了什么样的消息。 在CS中,可以重写WndProc函数,来捕捉所有发生有窗口消息。这样,我们就可以"篡改"传入的消息,而人为的让窗口改变行为。 大家用MSN的时候会发现,当直接关闭窗口时,窗口不会关闭而会最小化到托盘。我估计它使用的也是这样的道理。 下面就看一下关于这种方法的使原创 2007-01-10 21:21:00 · 2807 阅读 · 0 评论 -
一个Xp风格的表单类(一)-.NET教程,报表/图形/Office
其实是一个 无边框窗体,写成的表单类....但是外表看起来和普通的form完全一样. 呵呵. 最可惜的是,现在还没找到,在工具栏上放菜单的办法......哭.... 下面是运行时候的图片.. 我喜欢程序,更喜欢程序有个pl的界面.... 但是网上似乎找不到详细的,关于此方面的教程或源码. 重绘时改用了双缓冲,在窗体上有动画的时候,重绘不会出现闪烁的现象了. 献丑一下,把源码贴出来,大家一起交流..原创 2007-01-10 22:04:00 · 652 阅读 · 0 评论 -
仿QQ窗口代码
/* * Created with SharpDevelop. * User: Gary Perkin * Date: 02/03/2005 * Time: 08:31 * */ using System;using System.Windows.Forms;namespace DefaultNamespace{ /// /// De***ion of MainForm. /// pu原创 2007-01-11 10:39:00 · 933 阅读 · 0 评论 -
C#自画窗体的实现
我平时比较喜欢使用delphi,小生不才,我随然喜欢delphi,平时开发(至少现在)多用delphi,但是不怕各位高手笑话,我没有用delphi写过控件,虽然原理上知道,但总感觉不知无从下手:L 但是自从接触了c#,她哪优美的身姿(代码风格),风骚而不放纵的性格(对面向对象的体现比较好,要比delphi强),深深打动了我。经过一段时间的操练,我发现在开发控件及组件上(别的方面,小生我不敢妄断)原创 2007-01-09 16:59:00 · 1329 阅读 · 0 评论 -
创建不规则窗体和控件
创建不规则窗体和控件 在以前版本的Visual Basic或Visual C++中,创建不规则窗体和控件是一件很复杂的事,不仅需要调用大量API函数而且工作量也不小。不过,现在在Visual C#下,情况就完全不同了。运用Windows Forms你就可以很轻易地创建出一个不规则的窗体以及窗体上的控件。一个具有不规则窗体和控件的应用程序原创 2007-01-12 10:17:00 · 749 阅读 · 0 评论 -
无边框,可调整大小的FORM
private int WS_SIZEBOX = 0x00040000; protected override CreateParams CreateParams { get { // TODO: 添加 Form1.CreateParams getter 实现 CreateParams param = base.CreateParams; param.Style |=原创 2007-01-12 11:33:00 · 1180 阅读 · 0 评论 -
每个开发人员现在应该下载的十种必备工具
每个开发人员现在应该下载的十种必备工具 发布日期: 7/20/2004 | 更新日期: 7/20/2004本文自发布以来已经增加了新信息。请参阅下面的编辑更新。本文讨论: • 用于编写单元测试的 NUnit原创 2007-01-14 23:13:00 · 630 阅读 · 0 评论 -
自绘菜单
private void MEN_FILE_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) { Rectangle rc = new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height); e.Graphics.FillRec原创 2007-01-15 10:06:00 · 701 阅读 · 0 评论 -
按钮、菜单的重绘代码
按钮、菜单的重绘代码 using System; using System.Drawing; using System.Windows; using System.Windows.Forms; namespace ControlSet { /**//// /// 自绘按钮 /// public class MyButton : System.Windows.Forms.But原创 2007-01-15 10:10:00 · 680 阅读 · 0 评论 -
C# 一些小问题收集
C# 一些小问题收集 1. 怎么判断一个字符串的内容为数字? 最佳答案是使用正则表达式判断 string str; ... int i; if(str != null && Regex.IsMatch(str,@"^/d+$")) i = int.Parse(str); 2. 怎样使用WebService传输文件? 这里有两个办法 一个是使用byte[]传递,一个是使用WSE附件传递 前原创 2007-01-15 10:26:00 · 763 阅读 · 0 评论 -
匈牙利命名法
匈牙利命名法是一名匈牙利程序员发明的,而且他在微软工作了多年。此命名法就是通过微软的各种产品和文档传出来的。多数有经验的程序员,不管他们用的是哪门儿语言,都或多或少在使用它 这种命名法的基本原则是: 变量名=属性+类型+对象描述 即一个变量名是由三部分信息组成,这样,程序员很容易理解变量的类型、用途,而且便于记忆。 下边是一些推荐使用的规则例子,你可以挑选使用,也可原创 2007-01-15 10:52:00 · 734 阅读 · 0 评论 -
GDI+编程10个基本技巧!
songsu» 2006-6-23 14:29:00原创 2007-01-15 10:56:00 · 1077 阅读 · 0 评论 -
C#用webbrowser在Form中嵌入并且操作Excel表格,如何让他不提示是否保存并取消保存
C#用webbrowser在Form中嵌入并且操作Excel表格,如何让他不提示是否保存并取消保存?<!--google_ad_client = "pub-0746388214181358";google_ad_width = 336;google_ad_height = 280;google_ad_format = "336x280_as";google_ad_t原创 2007-04-12 18:43:00 · 6010 阅读 · 1 评论