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.
- Imports System.Runtime.InteropServices
Next, create a Structure named side to declare values of the top, bottom, right side, and left side values.
- Public Structure side
- Public Left As Integer
- Public Right As Integer
- Public Top As Integer
- Public Bottom As Integer
- End Structure
Then we will import the dwmapi.dll as a Function named DwmExtendFrameIntoClientArea to access the Frame.
- <Runtime.InteropServices.DllImport("dwmapi.dll")> Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As side) As Integer
- End Function
In your Timer_Tick have this code below to maximize the opacity of your form.
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- If Me.Opacity.ToString() > 0 Then
- Me.Opacity = Me.Opacity.ToString() + 0.05
- End If
- 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.
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Me.BackColor = Color.Black
- Dim side As side = New side
- side.Left = -1
- side.Right = -1
- side.Top = -1
- side.Bottom = -1
- Dim result As Integer = DwmExtendFrameIntoClientArea(Me.Handle, side)
- Catch ex As Exception
- End Try
- End Sub
For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.
Engr. Lyndon R. Bermoy
IT Instructor/System Developer/Android Developer
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.