|
-
Jan 23rd, 2001, 06:19 AM
#1
Thread Starter
New Member
Is it possible to change the border colour of a listbox in any way? Through the API or not?
-
Jan 23rd, 2001, 06:09 PM
#2
Addicted Member
I've got code that will change the border style, but not the colour, if you want it...
Building A Better Body Albeit Left Out Under Intense Extrapolation
-
Jan 23rd, 2001, 06:25 PM
#3
Thread Starter
New Member
OK sure please!! Its a good start isn't it!
Thanks in advance (although I'd still like to hear from anyone with colour code!)
«davidc»
-
Jan 23rd, 2001, 06:31 PM
#4
Addicted Member
BAS Module Code
Code:
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetWindowPos Lib "user32" (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
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_CLIENTEDGE = &H200
Private Const WS_EX_STATICEDGE = &H20000
Private Const SWP_FRAMECHANGED = &H20
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOOWNERZORDER = &H200
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOZORDER = &H4
Public Function AddOfficeBorder(ByVal hwnd As Long)
Dim lngRetVal As Long
'Retrieve the current border style
lngRetVal = GetWindowLong(hwnd, GWL_EXSTYLE)
'Calculate border style to use
lngRetVal = lngRetVal Or WS_EX_STATICEDGE And Not WS_EX_CLIENTEDGE
'Apply the changes
SetWindowLong hwnd, GWL_EXSTYLE, lngRetVal
SetWindowPos hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOOWNERZORDER Or SWP_NOZORDER Or SWP_FRAMECHANGED
End Function
Building A Better Body Albeit Left Out Under Intense Extrapolation
-
Jan 23rd, 2001, 06:32 PM
#5
Addicted Member
Oops...
To use:
AddOfficeBorder YourControl.hWnd
Building A Better Body Albeit Left Out Under Intense Extrapolation
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|