Hello. How can I enable the cool vista aero effects within my vb.net application? I wish to make portions of the form, or prehaps even the whole form, have the transparent glass effect. Any thoughts?
Printable View
Hello. How can I enable the cool vista aero effects within my vb.net application? I wish to make portions of the form, or prehaps even the whole form, have the transparent glass effect. Any thoughts?
Nice signature there. :thumb:
Which version of .NET are you using? Have you heard about Windows Presentation foundation? Or even simpler, have you tried setting the Opacity property of the form?
Think you misspelled the link, otherwise, you forgot this:
:)Quote:
Great sfotware comes from great thinkers
Haha thanks guys. I am currently using VB.NET 2005. Adjusting the opacity just changes the visibility of the form. I am looking to use the windows API if it is available to create the glass look for portions of my form.
Another unreleated question, do any of you know how to make vista go to sleep with a function withing VB.NET? I was looking and could not find anything. Thanks in advance.
Good to see you again TCanuck! :wave:
To get the Aero Glass effect, I think you can try the DwmExtendFrameIntoClientArea API. I stand corrected though, but test this application on your Vista, as only Vista supports the Desktop Window Manager DLLs
I hope it helps :)
The above post by Hannes is basically based on WPF. Look at this link on MSDN.
Added the link..
http://blogs.msdn.com/tims/archive/2...18/578637.aspx
This is an older thread, but I found it with a direct google search.
Since, there isn't a complete answer to this question in the forum, I figured this may help someone else searching for a quick answer.
Although, Hannes was right ofcourse.
Code:Private Declare Function apiDwmExtendFrameIntoClientArea Lib "dwmapi" Alias "DwmExtendFrameIntoClientArea" (ByVal hWnd As Int32, ByRef pMarinset As MARGINS) As Int32
Private Declare Function apiDwmIsCompositionEnabled Lib "dwmapi" Alias "DwmIsCompositionEnabled" (ByRef enabledptr As Boolean) As Boolean
Public Structure MARGINS
Public cxLeftWidth, cxRightWidth, cyTopHeight, cyBottomHeight As Int32
End Structure
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If IsAeroEnabled() = True Then
Me.BackColor = Color.Black
GlossWindow(Me.Handle.ToInt32, -1, 0, 0, 0)
End If
End Sub
Public Function IsAeroEnabled() As Boolean
apiDwmIsCompositionEnabled(IsAeroEnabled)
End Function
Public Sub GlossWindow(ByVal hWnd As Int32, ByVal leftMargin As Int32, ByVal rightMargin As Int32, ByVal topMargin As Int32, ByVal bottomMargin As Int32)
Dim margins As New MARGINS
margins.cxLeftWidth = leftMargin
margins.cxRightWidth = rightMargin
margins.cyTopHeight = topMargin
margins.cyBottomHeight = bottomMargin
apiDwmExtendFrameIntoClientArea(hWnd, margins)
End Sub
Remember that the Aero theming is not available in Vista Home Basic or Windows 7 Starter editions