
- Hueaitixaydung-Công nghệ thông tin-Tin học xây dựng đại -ĐHXD Hà Nội
- →
- Diễn đàn office 2003
- →
- Hỏi đáp về VBA - Macro
- →
- Lỗi không làm form trong suốt được!
|
• Thủ thuật Blog • Bài Viết Chú Ý • Hướng Dẫn Sử Dụng Diễn Đàn • Danh Sách Các Forum Zetaboards |
|
| Lỗi không làm form trong suốt được!; Lỗi không làm form trong suốt được! | |
|---|---|
| Tweet Topic Started: Nov 12 2010, 01:28 PM (816 Views) | |
| Post #1 Nov 12 2010, 01:28 PM | hoaanhsang |
|
Làm trong suốt form Bạn hãy đặt đoạn code này vào module của form bạn cần làm trong suốt. Code: Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long 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 crey As Byte, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long Private Const GWL_EXSTYLE = (-20) Private Const WS_EX_LAYERED = &H80000 Private Const LWA_ALPHA = &H2& Public hWnd As Long Private Sub Transparent(bytOpacity As Byte) 'bytOpacity : có giá trị từ 0-255 bytOpacity = 192 ' variable keeping opacity setting hWnd = FindWindow("ThunderDFrame", Me.Caption) Call SetWindowLong(Me.hWnd, GWL_EXSTYLE, GetWindowLong(Me.hWnd, GWL_EXSTYLE) Or WS_EX_LAYERED) Call SetLayeredWindowAttributes(Me.hWnd, 0, bytOpacity, LWA_ALPHA) End Sub Sau đó bạn có thể tạo một nút lệnh, và gọi thủ tục Transparent và truyền giá trị từ 0 đến 255 xem sao. Chúc bạn thành công. Edited by hoaanhsang, Nov 12 2010, 01:43 PM.
|
Administrator
|
|
![]() |
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Hỏi đáp về VBA - Macro · Next Topic » |
| Theme: Zeta Original | Track Topic · E-mail Topic |
3:49 AM Jul 11
|
Hosted for free by ZetaBoards · Privacy Policy




3:49 AM Jul 11