Aero Glass Screen Effect in VB.NET

Submitted by: 
Visitors have accessed this post 2221 times.

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 Bermoy
IT Instructor/System Developer/Android Developer/Freelance Programmer
Mobile: 09488225971
Landline: 826-9296
E-mail:[email protected]

Add and Follow me on Facebook: https://www.facebook.com/donzzsky

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


Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • You may insert videos with [video:URL]
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <th> <img> <h1> <h2> <h3> <iframe> [video]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.