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.622 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. |
Neu! sevDTA 3.0 Pro ![]() SEPA mit Kontonummernprüfung Erstellen von SEPA-Dateien mit integriertem BIC-Verzeichnis und Konto- nummern-Prüfverfahren, so dass ungültige Bankdaten bereits im Vorfeld ermittelt werden können. 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. TOP Entwickler-Paket ![]() TOP-Preis!! Mit der Developer CD erhalten Sie insgesamt 24 Entwickler- komponenten und Windows-DLLs. Die Einzelkomponenten haben einen Gesamtwert von 1866.50 EUR... |
||||||||||||||||
|
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


