Rubrik: Grafik und Font · Sonstiges | VB-Versionen: VB4, VB5, VB6 | 11.04.01 |
3D-Rahmen per API Verändern Sie das Aussehen Ihrer Fenster, indem Sie 3D-Rahmen zeichnen... | ||
Autor: Heinz Prelle | Bewertung: | Views: 20.428 |
www.visual-basic5.de | System: Win9x, WinNT, Win2k, WinXP, Win7, Win8, Win10, Win11 | Beispielprojekt auf CD |
Zum nachfolgenden Tipp gibt es eigentlich nicht viel zu schreiben...einfach einmal ausprobieren und die Werte etwas verändern. Es wird in jedem Fall ein Rechteck mit 3D-Rahmen gezeichnet, so daß sich das Fenster optisch von den Standard-Windows-Fenstern abhebt.
' zunächst die benötigten API-Deklarationen Private Declare Function GetClientRect Lib "user32" ( _ ByVal hwnd As Long, _ lpRect As RECT) As Long Private Declare Function DrawEdge Lib "user32" ( _ ByVal hdc As Long, _ qrc As RECT, _ ByVal edge As Long, _ ByVal grfFlags As Long) As Long Private Declare Function InflateRect Lib "user32" ( _ lpRect As RECT, _ ByVal x As Long, _ ByVal y As Long) As Long Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Const BDR_SUNKENINNER = &H8 Private Const BDR_SUNKENOUTER = &H2 Private Const BDR_SUNKENLIGHT = &H12 Private Const BDR_RAISEDDARK = &H11 Private Const BDR_FRAMELIGHT = &H6 Private Const BDR_FRAMEDARK = &H9 Private Const BDR_RAISEDINNER = &H4 Private Const BDR_RAISEDOUTER = &H1 Private Const BDR_SUNKEN = &HA Private Const BDR_INNER = &HC Private Const BDR_OUTER = &H3 Private Const BDR_RAISED = &H5 Private Const BF_RIGHT = &H4 Private Const BF_TOP = &H2 Private Const BF_BOTTOM = &H8 Private Const BF_LEFT = &H1 Private Const BF_FLAT = &H4000 Private Const BF_SOFT = &H1000 Private Const BF_RECT = (BF_LEFT Or BF_TOP Or _ BF_RIGHT Or BF_BOTTOM) Private Const BF_DIAGONAL = &H10 Private Const BF_ADJUST = &H2000 ' 3D-Rahmen zeichnen Dim rRect As RECT Call GetClientRect(Me.hwnd, rRect) Call DrawEdge(Me.hdc, rRect, BDR_FRAMELIGHT, BF_RECT) Call InflateRect(rRect, -30, -30) Call DrawEdge(Me.hdc, rRect, BDR_RAISEDINNER, BF_RECT)