这个无边框拖动船体,代码很少,却总是记不住,于是就在网上搜了这段代码,记录一下,省的再忘 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WindowsApplication1 { pub
第一步:将窗体的FormBoderStyle属性设置为None: 第二步:添加一个新类:Win32.cs 代码如下: public class Win32 { [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport("user32.dll")] public static extern int SendMessage(IntPtr hWnd, int Msg,
private const int WM_NCLBUTTONDOWN = 0XA1; private const int HTCAPTION = 2; [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "SendMessageA")] private static extern int SendMessage(int hwnd, int wMsg, int wParam, int
前言 之前將.net 1.1 Windows Form程式升級到.net 4.0,結果在開畫面時,閃的非常利害! 於是就開始找解決方法. 研究及解決 開始找到了設定DoubleBuffer=true,這個有一點點用,在高檔的機器上面,但是在4年前的NB問題還是一樣,尤其是當畫面物件很多時,感覺是一個一個畫出來! 還是被USER噹~~ 後來找到了「How to fix the flickering in User controls」,照他的方式來做,效能果然是一粒一的好呀! 他的方式是在Form
Expression构建DataTable to Entity 映射委托 1 namespace Echofool.Utility.Common { 2 using System; 3 using System.Collections.Generic; 4 using System.Data; 5 using System.Linq.Expressions; 6 using System.Reflection; 7 using System.Reflection.Emit; 8 9 publ
在用C#开发WinForm程序时,常发现TabControl出现严重的闪烁问题,这主要是由于TabControl控件在实现时会绘制默认的窗口背景.其实以下一段简单的代码可以有效的缓解该问题的发生.这就是技巧的作用,不需要理解太多的知识,但需要多多积累,就能做到事半功倍的效果. using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; namespace WfGUI.