using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; namespace WGClient { class AutoSizeFormClass { //(1).声明结构,只记录窗体和其控件的初始位置和大小. public struct controlRect { public int Left; public int Top; public int Width; public int
项目界面设计的时候,发现在设置button的enabled=false后,原本设计的字体颜色跟预设的不一样,查了一些资料后,在网上看到这样一段代码: [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int wndproc); [System.Runtime.InteropServices.Dll
自己写的winform窗体自适应大小代码,代码比较独立,很适合贴来贴去不会对原有程序造成影响,可以直接继承此类或者把代码复制到自己的代码里面直接使用 借鉴了网上的一些资料,最后采用重写WndProc方法,这样可以兼顾窗体拖拽调整窗体大小和最大化.最小化方法,而且代码比较简练,代码侵入性较小 using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using Sys
来源:http://www.cnblogs.com/kzloser/archive/2012/11/23/2783305.html Tree Control 控件(MSDN 链接) 说明: 树形控件是用于构造树形的结构,其中有一个根接点(Root)然后下面有许多子结点,而每个子结点上有允许有一个或多个或没有子结点.在树形控件中每一个结点都有一个句柄(HTREEITEM),同时添加结点时必须提供该结点的父结点句柄(其中根Root结点只有一个,既不可以添加也不可以删除), MFC 中使用 CTree