نام کلوب :ویژوال بیسیک
نام انگلیسی : visualbasicpro
تاسیس : 14 بهمن 1383
1096 عضو ، 306 بحث ،

ویژوال بیسیک

تبلیغات

__
عنوان بحث
ساخت فرمم شیشه ای!!!!!
26 فروردین 84 - 14:16
با این کد شما می توانید فرم خود را شیشه ای کنید...



Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex 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 Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Private Const GWL_EXSTYLE = (-20)

Private Const LWA_ALPHA = &H2

Private Const WS_EX_LAYERED = &H80000



' ######### FUNCTION ##################

Public Function Trans(ByVal hwnd As Long, Perc As Integer) As Long

Dim Msg As Long
On Error Resume Next
If Perc < 0 Or Perc > 255 Then
Trans = 1
Else
Msg = GetWindowLong(hwnd, GWL_EXSTYLE)
Msg = Msg Or WS_EX_LAYERED
SetWindowLong hwnd, GWL_EXSTYLE, Msg
SetLayeredWindowAttributes hwnd, 0, Perc, LWA_ALPHA
Trans = 0
End If
If Err Then
Trans = 2
End If

End Function
______________________________________________________________________________-

Private Sub Form_Activate()


Trans Form1.hwnd, 100


End Sub



پاسخ ها
تا کنون پاسخی به این بحث داده نشده است.
__