Dreevoo.com | Online Learning and Knowledge Sharing
 
Home | Programs | Programming languages | Visual Basic | Windows Aero application window
Guest
Click to view your profile
Topics
Programs
Languages
Recipes
Home
Shortcuts
 
 

Windows Aero application window

We're going to create a Windows Aero style application window which can then be used as a basis for other applications.

 
  Author: mat | Version: 2010 | 4th November 2011 |  
 
 
1.
 

Open a new Windows Forms Application document.

 
 
2.
 

Double click the Form window to enter the code entry mode.

 
 
3.
 

Delete everything, you need an empty window (see picture) ...

 
 
4.
 

... and copy/paste the following code:

Imports System.Runtime.InteropServices

Public Class Form1

    <StructLayout(LayoutKind.Sequential)> Public Structure MARGINS
        Public Left As Integer
        Public Right As Integer
        Public Top As Integer
        Public Bottom As Integer
    End Structure

    <DllImport("dwmapi.dll")> Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As MARGINS) As Integer
    End Function

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim margins As MARGINS = New MARGINS
        margins.Left = -1
        margins.Right = -1
        margins.Top = -1
        margins.Bottom = -1
        Dim hwnd As IntPtr = Handle
        Dim result As Integer = DwmExtendFrameIntoClientArea(hwnd, margins)
        Me.BackColor = Color.Black

    End Sub

End Class

 
 
5.
 

Click Start Debugging button or press F5 to start the program.

 
 
6.
 

Your application, the Aero window should start right up.

The color of the window is the same as you Aero system color. This app will only run properly on a Windows Vista or Windows 7 System.

 
 
 
   
  Please login to post a comment
  Click to open user profile  
danielfox, 28th Feb 2024, 12:47 PM
Today, I want to take a moment to express my deepest gratitude to each and every one of you. Your support, kindness, and encouragement have been a guiding light on my journey.In a world where negativity can often overshadow the good, I am continually reminded of the beauty that exists within the hearts of those around me. Your words of encouragement, your gestures of kindness, and your unwavering belief in me have lifted me up during times of doubt and uncertainty.I am grateful for the laughter we've shared, the challenges we've overcome together, and the memories we've created along the way. Your presence in my life is a gift that I cherish deeply.As we navigate the ups and downs of life's journey, let us continue to support and uplift one another. Together, we are stronger, braver, and more resilient than we could ever be alone.Thank you, from the bottom of my heart, for being a part of my life and for making each day a little brighter.
анкор

 
 
  Click to open user profile  
hodamow5, 29th Feb 2024, 4:16 AM
Our planet is a magnificent place full of charm, adventure, and beauty. If we just keep our eyes open, the adventures we can have are endless.
 
   
 
 
online learning made for people
Dreevoo.com | CONTRIBUTE | FORUM | INFO