如题

解决方案 »

  1.   

    我看到过一个列表,使自己编的,可以显示背景,从control 继承
      

  2.   

    从codeproject拷过来的一段例子代码,效果不是很好,没来得及改 public class ImageListView : System.Windows.Forms.ListView
    {
    public ImageListView() : base()
    {
    this.SetStyle(ControlStyles.DoubleBuffer| ControlStyles.UserPaint|ControlStyles.ResizeRedraw, true);
    }... protected override void WndProc(ref Message m)
    {
    /*
    // TODO:  添加 ImageListView.WndProc 实现
    switch(m.Msg)
    {
    // case (int)Msgs.WM_ERASEBKGND :
    // break; case (int)Msgs.WM_PAINT :
    if(internalImage==null)
    this.OnResize(EventArgs.Empty);
    Win32.RECT updateRect = new Win32.RECT();
    if( User32.GetUpdateRect( m.HWnd, ref updateRect, false) == 0 )
    break;

    Win32.PAINTSTRUCT paintStruct = new Win32.PAINTSTRUCT();
    IntPtr screenHdc = User32.BeginPaint(m.HWnd, ref paintStruct);
    internalGraphics = Graphics.FromImage(internalImage);
    using( Graphics screenGraphics = Graphics.FromHdc( screenHdc ) ) 
    { //Draw Internal Graphics
    IntPtr hdc = internalGraphics.GetHdc();
    Message printClientMessage = Message.Create( Handle, 0x0318, hdc, IntPtr.Zero );  
    DefWndProc( ref printClientMessage );
    internalGraphics.ReleaseHdc( hdc ); //Add the missing OnPaint() call
    OnPaint( new PaintEventArgs( internalGraphics, Rectangle.FromLTRB( 
    updateRect.left,
    updateRect.top,
    updateRect.right,
    updateRect.bottom ) ) ); //Draw Screen Graphics
    screenGraphics.DrawImage( internalImage, 0, 0);//this.Right - sourceImage.Width, this.Bottom - sourceImage.Height );
    } //Tear down
    User32.EndPaint( m.HWnd, ref paintStruct );
    return;
    break;
    }
    */