
c#
gaonii
这个作者很懒,什么都没留下…
展开
-
c# 窗口图片绘制
在load中是无效的...写在paint中吧原创 2015-01-27 19:49:07 · 745 阅读 · 0 评论 -
c# capture = true
这东西邪门的很~ 开了之后无法相应 MouseDown 和 MouseUp了msdn: 当控件已捕获鼠标时,它接收鼠标输入,不论光标是否在其边框内。 通常只有在执行拖动操作时才捕获鼠标。using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;u原创 2015-01-09 11:33:39 · 686 阅读 · 0 评论 -
c# 截图
public partial class Form1 : Form { //导入 GetWindowDC函数 用于得到要截图窗口的句柄 [System.Runtime.InteropServices.DllImport("user32.dll")] public extern static IntPtr GetWindowDC(In原创 2015-01-11 14:19:28 · 607 阅读 · 0 评论 -
c# 实现鼠标拖动form
private void Form1_MouseDown(object sender, MouseEventArgs e) { int x, y; if (e.Button == MouseButtons.Left) { // e.X, e.Y 是鼠标在窗口的相对坐标,原创 2015-01-12 09:58:01 · 740 阅读 · 0 评论 -
C#中怎样让控件大小随着窗体大小变化而变化?
// http://bbs.youkuaiyun.com/topics/901609151.Anchor改为None 效果勉强 勉强的意思是 窗体到一定程度小的时候还是会消失2.Dock 改为 Fill 好像没啥用...3.重写ReSize事件 计算比例什么的 最正确的方法原创 2015-01-12 16:45:46 · 2346 阅读 · 0 评论 -
c#建立验证码图片
private string strVaildateCode; public string GetRandomNumberString(int Number) { string strNumber = string.Empty; Random theRandomNumber = new Random();原创 2015-01-12 17:04:18 · 390 阅读 · 0 评论 -
c#如何esc退出Form
private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { this.Close(); } }记得把 Forn的 keyPreview原创 2015-01-01 09:21:36 · 5520 阅读 · 1 评论 -
如何实现C# button定义热键
C# button的运用是很广泛的,但是对C# button如何定义热键大家就很少用了,本文讲了两种C# button定义热键的方法,希望有一种方法适合你。 在工程中如果给form的C# button定义了热键,无疑会给软件的可用性增加很大的筹码。 C# button定义热键方法一: 在button的text属性中输入&f,这样alt+f或者直接按f就可以 响应相应的转载 2015-01-03 10:43:36 · 4184 阅读 · 0 评论 -
c# 菜单设置快捷键
似乎一级菜单无法设置 System.Windows.Forms.Shortcut 只能用menu.Text = "...(&)" 不知道为什么原创 2015-01-03 12:03:13 · 2566 阅读 · 0 评论