Skip to main content

Aero Glass Screen Effect in VB.NET


Today, I will teach you how to create a program that has a screen effect of aero glass in vb.net. We often see an aero glass effect as a theme in windows 7.

Now, we will start the tutorial.

1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application.

2. Next, add only a Timer named Timer1 in your Form.

3. Then let's go to the code.

We will import Runtime.InteropServices library to access the operation services during runtime period.

  1. Imports System.Runtime.InteropServices

Next, create a Structure named side to declare values of the top, bottom, right side, and left side values.

  1. Public Structure side
  2. Public Left As Integer
  3. Public Right As Integer
  4. Public Top As Integer
  5. Public Bottom As Integer
  6. End Structure

Then we will import the dwmapi.dll as a Function named DwmExtendFrameIntoClientArea to access the Frame.

  1. <Runtime.InteropServices.DllImport("dwmapi.dll")> Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As side) As Integer
  2.  
  3. End Function

In your Timer_Tick have this code below to maximize the opacity of your form.

  1. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  2. If Me.Opacity.ToString() > 0 Then
  3. Me.Opacity = Me.Opacity.ToString() + 0.05
  4. End If
  5. End Sub

Then in your Form_Load, we will put values to our side as Structure and will access the result of DwmExtendFrameIntoClientArea then we will enable the time.

  1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2. Try
  3. Me.BackColor = Color.Black
  4. Dim side As side = New side
  5. side.Left = -1
  6. side.Right = -1
  7. side.Top = -1
  8. side.Bottom = -1
  9. Dim result As Integer = DwmExtendFrameIntoClientArea(Me.Handle, side)
  10. Catch ex As Exception
  11.  
  12. End Try
  13.  
  14. Timer1.Start()
  15.  
  16. End Sub

Output:

output

For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.

Best Regards,

Engr. Lyndon R. Bermoy
IT Instructor/System Developer/Android Developer
Mobile: 09079373999
Telephone: 826-9296
E-mail:[email protected]

Visit and like my page on Facebook at: https://www.facebook.com/BermzISware

Subscribe at my YouTube Channel at: Ser Bermz

Visit my website at: www.campcodes.com

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.