Mit dem nachfolgenden Tipp ist es möglich mit wenigen Anweisungen, Command- & Optionbuttons, Picture- & Checkboxen - einfach alle Objekte mit einer hWnd-Eigenschaft - mit einem 3D-Rahmen auszustatten. ' Allgemeine Deklaration ' 16Bit #If Win16 Then Declare Function GetWindowLong Lib "User" ( _ ByVal hWnd As Integer, _ ByVal nIndex As Integer) As Long Declare Function SetWindowLong Lib "User" ( _ ByVal hWnd As Integer, _ ByVal nIndex As Integer, _ ByVal dwNewLong As Long) As Long Declare Function SetWindowPos Lib "User" ( _ ByVal hWnd%, _ ByVal hWndInsertAfter%, _ ByVal X%, _ ByVal Y%, _ ByVal cX%, _ ByVal cY%, _ ByVal wFlags%) As Integer ' 32Bit #Else Declare Function GetWindowLong Lib "user32" _ Alias "GetWindowLongA" ( _ ByVal hwnd As Long, _ ByVal nIndex As Long) As Long Declare Function SetWindowLong Lib "user32" _ Alias "SetWindowLongA" ( _ ByVal hwnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Declare Function SetWindowPos Lib "user32" _ Alias "SetWindowPos" ( _ ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, _ ByVal x As Long, _ ByVal y As Long, _ ByVal cx As Long, _ ByVal cy As Long, _ ByVal wFlags As Long) As Long #End If Const GWL_STYLE = (-16) Const WS_THICKFRAME = &H40000 Const WS_CHILD = &H40000000 Const SWP_DRAWFRAME = &H20 Const SWP_NOMOVE = &H2 Const SWP_NOSIZE = &H1 Const SWP_NOZORDER = &H4 ' Aufruf Dim Style As Long Dim Ret As Long Style = GetWindowLong(OBJEKT.hWnd, GWL_STYLE) Style = Style& Or WS_THICKFRAME Ret = SetWindowLong(OBJEKT.hWnd, GWL_STYLE, Style) Ret = SetWindowPos(OBJEKT.hWnd, Form1.hWnd, 0, 0, 0, 0, _ SWP_NOZORDER Or SWP_NOSIZE Or SWP_NOMOVE Or SWP_DRAWFRAME) Beispiel: Private Sub Form_Load() Dim Style As Long Dim Ret As Long Style = GetWindowLong(Check1.hWnd, GWL_STYLE) Style = Style& Or WS_THICKFRAME Ret = SetWindowLong(Check1.hWnd, GWL_STYLE, Style) Ret = SetWindowPos(Check1.hWnd, Form1.hWnd, 0, 0, 0, 0, _ SWP_NOZORDER Or SWP_NOSIZE Or SWP_NOMOVE Or SWP_DRAWFRAME) End Sub Dieser Tipp wurde bereits 14.625 mal aufgerufen.
Anzeige
Diesen und auch alle anderen Tipps & Tricks finden Sie auch auf unserer aktuellen vb@rchiv (einschl. Beispielprojekt!) Ein absolutes Muss - Geballtes Wissen aus mehr als 8 Jahren vb@rchiv! - nahezu alle Tipps & Tricks und Workshops mit Beispielprojekten - Symbol-Galerie mit mehr als 3.200 Icons im modernen Look Weitere Infos - 4 Entwickler-Vollversionen (u.a. sevFTP für .NET), Online-Update-Funktion u.v.m. |
vb@rchiv CD Vol.6 ![]() Geballtes Wissen aus mehr als 8 Jahren vb@rchiv! Online-Update-Funktion Entwickler-Vollversionen u.v.m. Tipp des Monats Ralf Ehlert Aufrufende EXE aus DLL heraus ermitteln und beenden Mit diesem Code lässt sich aus der eigenen DLL heraus ermitteln, von welchen Anwendungen die eigenene DLL aktuell geladen und genutzt wird. sevOutBar 4.0 ![]() Vertikale Menüleisten á la Outlook Erstellen von Outlook ähnlichen Benutzer- interfaces - mit beliebig vielen Gruppen und Symboleinträgen. Moderner OfficeXP-Style mit Farbverläufen, Balloon-Tips, u.v.m. |
||||||||||||||||
|
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein. |
|||||||||||||||||


Objekte mit einem 3D-Rahmen ausstatten


