111,094
社区成员




/******************************************
-- Author : Coder.Yan
-- Create date : 2012-09-25 09:03:33
-- CopyRight : HZST (C) 2012
-- Description :
******************************************/
internal class ShapeLibView:ListView
{
[DllImport("uxtheme.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
private static extern int SetWindowTheme(IntPtr hWnd, string appName, string partList);
[DllImport("User32.dll")]
private static extern int SendMessage(IntPtr Handle, int wMsg, int wParam, int lParam);
const int LVM_FIRST = 0x1000;
const int LVM_SETICONSPACING = LVM_FIRST + 53;
public ShapeLibView()
{
InitializeComponent();
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this._contextMenu = new ContextMenuStrip(components);
this._images = new System.Windows.Forms.ImageList(this.components);
this.SuspendLayout();
this.LargeImageList = _images;
this.SmallImageList = _images;
//
// _images
//
this._images.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
this._images.ImageSize = new System.Drawing.Size(48, 48);
this._images.TransparentColor = System.Drawing.Color.Transparent;
this.ResumeLayout();
}
protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated(e);
SetWindowTheme(this.Handle, "explorer", null);
SendMessage(this.Handle, LVM_SETICONSPACING, 0, 70 * 65536 + 50);
}
}