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 13.881 mal aufgerufen.
Anzeige
![]() ![]() ![]() (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 Neu! sevCoolbar 3.0 ![]() Professionelle Toolbars im modernen Design! Mit sevCoolbar erstellen Sie in wenigen Minuten ansprechende und moderne Toolbars und passen diese optimal an das Layout Ihrer Anwendung an (inkl. große Symbolbibliothek) - für VB und MS-Access |
||||||||||||||||
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. |