April 23, 2024, 04:50:56 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Comboboxes

Started by Brian, June 17, 2018, 07:53:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian

June 17, 2018, 07:53:33 AM Last Edit: June 18, 2018, 06:11:41 AM by Brian Pugh
Hi,

Is it possible to remove the 3D border from a combobox, and just leave a line border? I can do edit boxes with MODIFYEXSTYLE win,0,WS_EX_CLIENTEDGE,ID, and then REDRAWFRAME, but it doesn't seem to apply to comboboxes

Many thanks,

Brian

PS: Found some code, but I don't know how to convert it. No, let's say I don't understand it!

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 GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex 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_NOACTIVATE = &H10
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOOWNERZORDER = &H200
Private Const SWP_NOREDRAW = &H8
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOZORDER = &H4
Private Const SWP_SHOWWINDOW = &H40

Public Function ThinBorder(ByVal lhWnd As Long, ByVal bState As Boolean)
Dim lS As Long
   lS = GetWindowLong(lhWnd, GWL_EXSTYLE)
   If Not (bState) Then
      lS = lS Or WS_EX_CLIENTEDGE And Not WS_EX_STATICEDGE
   Else
      lS = lS Or WS_EX_STATICEDGE And Not WS_EX_CLIENTEDGE
   End If
   SetWindowLong lhWnd, GWL_EXSTYLE, lS
   SetWindowPos lhWnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOOWNERZORDER Or SWP_NOZORDER Or SWP_FRAMECHANGED
End Function

LarryMc

my guess is you'd have to do it with the ownerdrawn flag then subclass the editcontrol portion of the control.
Don't ask me to give you an example. LOL
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

that code doesn't do anything to a combobox
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library