请问如何让ListBox半透明,已经可以让Form半透明,但对ListBox无效!
Public Sub MakeWindowLayered(hwnd As Long)
    Dim ExStyles As Long
    
    ExStyles = ExStyles Or WS_EX_LAYERED
    
    SetWindowLong hwnd, GWL_EXSTYLE, ExStyles
End Sub
Public Sub SetOpacity(hwnd As Long, Opacity As Byte)
    SetLayeredWindowAttributes hwnd, 0, Opacity, LWA_ALPHA
End Sub

解决方案 »

  1.   

    设Form, list也是透明的。
    设LIst 没变化
      

  2.   

    把ListBox放入PictureBox里面试试看吧
    可能有用
      

  3.   

    listbox自己能够重绘当然无效了。
    拦截listbox的重绘,然后自己draw
      

  4.   

    Layered window 只能是顶层窗口
      

  5.   

    SetLayeredWindowAttributes 只能针对顶层窗口,这个说法是正确的
    如果要实现局部窗口透明需要修改窗口风格
      

  6.   

    SetLayeredWindowAttributes 只能针对顶层窗口,这个说法是正确的
    如果要实现局部窗口透明需要修改窗口风格怎么修改啊?