
.Net WinForm技巧
文章平均质量分 64
diandian82
这个作者很懒,什么都没留下…
展开
-
RichTextBox中插入图片的方法
1. 通过剪切板来实现。public void InsertImage() { string lstrFile = fileDialog.FileName; Bitmap myBitmap = new Bitmap(lstrFile); // Copy the bitmap to the clipboard. Clipboard.SetDataObject(myBit原创 2006-08-30 18:19:00 · 1392 阅读 · 0 评论 -
Function for write windows log in C#
Function for write windows log in C#原创 2010-06-04 22:10:00 · 697 阅读 · 0 评论 -
使用自定义的鼠标指针
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices;using原创 2007-03-19 15:54:00 · 947 阅读 · 0 评论 -
改变ListBox中Items的颜色,并且为ListBox中的项目添加图片。
改变ListBox中Items的颜色,并且为ListBox中的项目添加图片。这个很简单,只需要下面几个步骤:1. DrawMode属性设置为自己画// ListBox1is ListBox controlthis.ListBox1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;2. 添加原创 2006-08-01 12:42:00 · 5141 阅读 · 2 评论 -
使用剪切板的方法
1.为剪切板设置数据,我们可以使用下面这个函数。Clipboard.SetDataObject(textBox1.Text,true);或者这样:DataObject m_data = new DataObject(); m_data.SetData(DataFormats.Text,true,textBox1.Text);原创 2006-07-31 11:21:00 · 1919 阅读 · 0 评论 -
使用SendMessage方法对窗体上的控件进行截图,该方法的思想就是把控件的句柄拿到,对控件发送WM_PAINT消息,并且把希望得到图形对象的句柄当作wParam参数传过去,这样就可以在图形对象得到想要得图形。
使用SendMessage方法对窗体上的控件进行截图,该方法的思想就是把控件的句柄拿到,对控件发送WM_PAINT消息,并且把希望得到图形对象的句柄当作wParam参数传过去,这样就可以在图形对象得到想要得图形。 [System.Runtime.InteropServices.DllImport("user32.dll", CharSet = System.Runtime.InteropS原创 2006-07-31 11:21:00 · 3058 阅读 · 3 评论 -
Share data through MSMQ
firstly. you have to install MSMQ in your computer. Open your add/remove component in your control panel. Select Application Server/Message Queuing, then click OK to finish installing.In Computer pa原创 2006-12-03 18:38:00 · 867 阅读 · 0 评论 -
窗体的动态效果
using System.Runtime.InteropServices; private void Form2_Load(object sender, System.EventArgs e) { Win32.AnimateWindow(this.Handle,500, Win32.AW_BLEND); } public class Win32 { public const Int32 AW_原创 2006-10-25 17:55:00 · 788 阅读 · 0 评论 -
C# 使用重载消息处理函数的方式,实现没有标题栏的窗体的拖动。
private const int WM_NCHITTEST = 0x84; private const int HTCLIENT = 0x1; private const int HTCAPTION = 0x2; protected override void WndProc(ref Message m) {原创 2006-06-09 11:10:00 · 1470 阅读 · 0 评论 -
API改变控制台的颜色
class Class1 { static void Main(string[] args) { Class1 c =new Class1(); c.change(); } [DllImport("kernel32.dll", SetLastError=true)] public static extern bool SetConsoleTextAttribute( In原创 2006-10-25 17:58:00 · 914 阅读 · 0 评论 -
C# play with json in dynamic
var jsonString = @"{ 'id': '4', 'first_name': 'Mark', 'gender': 'male',原创 2014-12-09 15:03:59 · 712 阅读 · 0 评论