i want to make my project's look like windows 7 have..means glass interface, and buttons, all controls graphics like windows 7.
i have searched alot, but i could not find...can u help me regrading this?

Recommended Answers

All 15 Replies

transparency Window and all controls?

yes some thiing like this....means the buttons and forms look like windows 7's...

you can use API files to do this.

can u help me to do this.? i dont know about API files!!!

See if this help :

Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Private Const GWL_EXSTYLE As Long = -20
Private Const WS_EX_LAYERED As Long = &H80000
Private Const LWA_ALPHA As Long = &H2

Public Function Transparant(hwnd As Long, percent As Integer, pil As Boolean)
    Dim before As Long
    before = GetWindowLong(hwnd, GWL_EXSTYLE)
    If pil = True Then
        before = before Or WS_EX_LAYERED
        SetWindowLong hwnd, GWL_EXSTYLE, before
        SetLayeredWindowAttributes hwnd, 0, 255 * (percent / 100), LWA_ALPHA
    Else
        before = before And Not WS_EX_LAYERED
        SetWindowLong hwnd, GWL_EXSTYLE, before
    End If
End Function

Private Sub Form_Load()
Transparant Me.hwnd, Val(70), True  ' 70%
End Sub

Excellent work!!!!
can't command buttons and textboxes also change thier style?

yes,,you can make your all control seems like windows version..means in xp it looks in xp style or in win 7 its likes win 7..
just add manifest file on your project..

i dont know how to use manifest file...i have code of manifest and i have made manifest file, but i dont know the way how to use that...can u plz tell me..
i have manifest file in c with this path and name" C:/vb6/vb6.exe.manifest"
will you please tell me the way how to use that with vb and controls.

commented: whom are you trying to fool ? -2

and the code u have wrote above is not working on Midi Child Form....

commented: the will work if you try to understand it, not simply copy paste. -3

i dont know how to use manifest file...i have code of manifest and i have made manifest file, but i dont know the way how to use that...can u plz tell me..
i have manifest file in c with this path and name" C:/vb6/vb6.exe.manifest"
will you please tell me the way how to use that with vb and controls.

Put manifest file on your project folder.
ex : your exe project name is EmployeeData.exe then rename manifest file into EmployeeData.exe.manifest then running EmployeeData.exe. you will see the changed.

and the code u have wrote above is not working on Midi Child Form....

use your midi formname instance of me..

Private Sub Form_Load()
  Transparant YourFormName.hwnd, Val(70), True ' 70%
End Sub

SOrry Jx_both are not working.
i m creating an exe of my vb project and also creating manifest file in same folder, but changes are not shown...


and also not working on mdi..

Private Sub Form_Load()
  Transparant form2.hwnd, Val(60), True
End Sub

transperncy form in mdi form is working to me..
put the same code in mdi form..

and for the manifest file..
if the manifest file is not working then your exe file cannot shown up..
if exe file appear then manifest file is working.

if you follow my code correctly than all will running nice..

If this thread already answered then please mark this thread as solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.