VB透明窗體

2022-03-21 13:28:58 字數 1459 閱讀 5929

1樓:棘棘芽

private declare function setwindowlong lib "user32" alias "setwindowlonga" (byval hwnd as long, byval nindex as long, byval dwnewlong as long) as long

private declare function setlayeredwindowattributes lib "user32" (byval hwnd as long, byval crkey as long, byval balpha as byte, byval dwflags as long) as long

const ws_ex_layered = &h80000

const gwl_exstyle = (-20)

const lwa_alpha = &h2

'const lwa_colorkey = &h1

private sub form_load()

setwindowlong me.hwnd, gwl_exstyle, ws_ex_layered

setlayeredwindowattributes me.hwnd, 0, 150, lwa_alpha '150為透明度(0-255)

end sub

2樓:匿名使用者

全透明private declare function getwindowlong lib "user32" alias "getwindowlonga" (byval hwnd as long, byval nindex as long) as long

private declare function setwindowlong lib "user32" alias "setwindowlonga" (byval hwnd as long, byval nindex as long, byval dwnewlong as long) as long

private declare function setlayeredwindowattributes lib "user32" (byval hwnd as long, byval crkey as long, byval balpha as byte, byval dwflags as long) as long

private sub form_load()

me.borderstyle = 0

me.caption = ""

me.backcolor = vbred

setlayeredwindowattributes me.hwnd, vbred, 0, 1

end sub

3樓:新餘本土

不需要控制元件,用系統api即可。

VB窗體上的鍵盤事件

select case keyas case 70 keyname f1 增加你的執行 例如 text1.forecolor hff 文字框字型顏色,每個判斷下面都應該有執行 的 或文字框顯示內容,下同。text1.text f1 case 71 keyname f2 case 72 keyname...

關於VB中MDI窗體的問題,關於VB中MDI窗體的一個問題

private sub menclose click picture1.print i do until i 0 exit click i i 1 要有迴圈結束條件 loop end sub 1 private sub menclose click for i forms.count 1 to 0 ...

在VB窗體屬性中,BorderStyle屬性有0 5,這些功能分別都是什麼

b窗體borderstyle屬性功能設定的屬性值如下 borderstyle屬性值0 none,沒有邊框,無邊界框架。borderstyle屬性值1 fixedsingle,設定視窗大小固定不變,並且框架為單線。borderstyle屬性值2 sizable,設定為視窗大小可變,並且將框架設定為標準...