IonicWind Software

IWBasic => General Questions => Topic started by: Brian on June 17, 2018, 07:53:33 AM

Title: Comboboxes
Post by: Brian on June 17, 2018, 07:53:33 AM
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
Title: Re: Comboboxes
Post by: LarryMc on June 17, 2018, 08:00:20 PM
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
Title: Re: Comboboxes
Post by: LarryMc on June 18, 2018, 11:19:10 PM
that code doesn't do anything to a combobox