Salut voila un petit code pour rendre vos forms transparent avec le style Aero
difficulté : Copier coller
il suffit juste de mettre la propriété Backcolor de la form a Black
Résulta :
Cordialement,
TheMonax
difficulté : Copier coller
- Code:
#Region " Aero Style "
<StructLayout(LayoutKind.Sequential)> _
Public Structure MARGINS
Public cxLeftWidth As Integer
Public cxRightWidth As Integer
Public cyTopHeight As Integer
Public cyButtomheight 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
On Error Resume Next
Dim margins As MARGINS = New MARGINS
margins.cxLeftWidth = -1
margins.cxRightWidth = -1
margins.cyTopHeight = -1
margins.cyButtomheight = -1
'set all the four value -1 to apply glass effect to the whole window
'set your own value to make specific part of the window glassy.
Dim hwnd As IntPtr = Me.Handle
Dim result As Integer = DwmExtendFrameIntoClientArea(hwnd, margins)
End Sub
End Region
il suffit juste de mettre la propriété Backcolor de la form a Black
Résulta :
Cordialement,
TheMonax
Dernière édition par TheMonax le Sam 24 Mai - 8:54, édité 1 fois