Date: 02-16-2022
Return to Index
created by gbSnippets
'Here's a summary list of default control styles that I came up with,
'after reading Help and viewing a default control with WinSpy
Each control type has 5 lines following it.
1. styles found in WinSpy only
2. styles in Control Add but not in Control Styles topics
3. styles mentioned in both Control Styles and Control Add topics
4. EX styles found only in Control Add topics (none listed in Control Styles)
5. EX styles found in WinSpy only
BUTTON
%WS_Child, %WS_Visible, %BS_PushButton
%BS_Center, %BS_VCenter (neither found in WinSpy)
%WS_TABSTOP
%WS_Ex_Left
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
CHECK3STATE
%WS_Child, %WS_Visible
%BS_Left, %BS_VCenter (neither found in WinSpy)
%WS_TABSTOP, {%BS_AUTO3STATE}
%WS_Ex_Left
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
CHECKBOX
%WS_Child, %WS_Visible
%BS_Left, %BS_VCenter (neither found in WinSpy)
%WS_TABSTOP, {%BS_AUTOCHECKBOX}
%WS_Ex_Left
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
COMBOBOX
%WS_Child, %WS_Visible
---
%WS_TABSTOP, %CBS_SORT, %CBS_DROPDOWN, {%CBS_HASSTRINGS}
%WS_Ex_Left, %WS_Ex_ClientEdge
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
FRAME
%WS_Child, %WS_Visible
---
%BS_LEFT, {%BS_TOP, %BS_GROUPBOX} (neither BS_Left nor BS_Top found in WinSpy)
%WS_Ex_Left
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
GRAPHIC
%WS_TabStop
---
%WS_CHILD, %WS_VISIBLE, %SS_OWNERDRAW
--- (explicitly says there is no default EX)
%WS_Ex_Left, %WS_Ex_LTRReading, %WS_Ex_RightScrollbar
HEADER
IMAGE
%WS_Child, %WS_Visible
---
{%SS_ICON} or {%SS_BITMAP} - if omitted, PowerBASIC will assign based on image type
%WS_Ex_Left
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
IMAGEX
%WS_Child, %WS_Visible
---
{%SS_ICON} or {%SS_BITMAP} - if omitted, PowerBASIC will assign based on image type
%WS_Ex_Left
%WS_Ex_LTRReading, %WS_Ex_RightSc7rollbar
IMGBUTTON
%WS_Child, %WS_Visible, %BS_PushButton
---
%WS_TABSTOP, {%BS_ICON} or {%BS_BITMAP}
%WS_Ex_Left
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
IMGBUTTONX
%WS_Child, %WS_Visible, %BS_PushButton
---
%WS_TABSTOP, {%BS_ICON} or {%BS_BITMAP}
%WS_Ex_Left
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
LABEL
%WS_Child, %WS_Visible
---
%SS_LEFT
%WS_Ex_Left
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
LINE
%WS_Child, %WS_Visible
---
%SS_ETCHEDFRAME
%WS_Ex_Left
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
LISTBOX
%WS_Child, %WS_Visible
---
%WS_TABSTOP, %LBS_SORT, %LBS_NOTIFY, %WS_VSCROLL
%WS_Ex_ClientEdge, %WS_Ex_Left
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
LISTVIEW
%WS_Child, %WS_Visible
---
%WS_TABSTOP, %LVS_REPORT, %LVS_SHOWSELALWAYS
%WS_EX_Left
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
OPTION
%WS_Child, %WS_Visible
%BS_Left, %BS_VCenter (neither found in WinSpy)
%WS_TABSTOP, {%BS_AUTORADIOBUTTON}
%WS_Ex_Left
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
PROGRESSBAR
%WS_Child, %WS_Visible
---
%WS_BORDER
--- (no Ex, but not clarified as was done with Graphic Control
%WS_Ex_Left, %WS_Ex_LTRReading, %WS_Ex_RightScrollbar
SCROLLBAR
%WS_Child, %WS_Visible
---
{%SBS_HORZ} or {%SBS_VERT} 'default is SBS_Horz unless w < h)
%WS_Ex_Left
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
STATUSBAR
%WS_Child, %WS_Visible
---
%CCS_BOTTOM
--- (no Ex, but not clarified as was done with Graphic Control
%WS_Ex_Left, %WS_Ex_LTRReading, %WS_Ex_RightScrollbar
TAB
%WS_Visible
---
%WS_CHILD, %WS_TABSTOP
--- (no Ex, but not clarified as was done with Graphic Control
%WS_Ex_Left, %WS_Ex_LTRReading, %WS_Ex_RightScrollbar
TEXTBOX
%WS_Child, %WS_Visible
---
%WS_TABSTOP, %WS_BORDER, %ES_AUTOHSCROLL, %ES_LEFT
%WS_Ex_ClientEdge, %WS_Ex_Left
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
TOOLBAR
---
---
%WS_CHILD, %WS_VISIBLE, %WS_BORDER, %CCS_TOP, %TBSTYLE_FLAT
--- (no Ex, but not clarified as was done with Graphic Control
%WS_Ex_Left, %WS_Ex_LTRReading, %WS_Ex_RightScrollbar
TREEVIEW
%WS_Child, %WS_Visible
---
%WS_TABSTOP, %TVS_HASBUTTONS, %TVS_LINESATROOT, %TVS_HASLINES, %TVS_SHOWSELALWAYS
%WS_Ex_Left
%WS_Ex_LTRReading, %WS_Ex_RightScrollbar
'Compilable Example: (Jose Includes)
#Compile Exe
#Dim All
%Unicode=1
#Include "Win32API.inc"
Global hDlg as Dword
Function PBMain() As Long
Local st,ste as Long
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
DFS("button",st,ste)
Control Add Button, hDlg, 100,"Push", 50,10,100,20, st or %BS_MultiLine, ste
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
End Function
Sub DFS(cName$, st as Long, stE as Long) 'returns default style, extended style
Select Case LCase$(cName$)
Case "button", "btn"
st = %WS_Child or %WS_Visible or %BS_PushButton or %WS_TABSTOP or %WS_Ex_Left
ste = %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
'%BS_Center, %BS_VCenter (neither found in WinSpy)
Case "check3state","chk3"
st = %WS_Child or %WS_Visible or %WS_TABSTOP or %BS_AUTO3STATE
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
'%BS_Left, %BS_VCenter (neither found in WinSpy)
Case "checkbox", "chk"
st = %WS_Child or %WS_Visible or %WS_TABSTOP or %BS_AUTOCHECKBOX
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
'%BS_Left or %BS_VCenter (neither found in WinSpy)
Case "combobox", "cmb"
st = %WS_Child or %WS_Visible or %WS_TABSTOP or %CBS_SORT or %CBS_DROPDOWN or %CBS_HASSTRINGS
ste = %WS_Ex_Left or %WS_Ex_ClientEdge or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "frame", "fr"
st = %WS_Child or %WS_Visible or %BS_LEFT
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
'{%BS_TOP or %BS_GROUPBOX} (neither BS_Left nor BS_Top found in WinSpy)
Case "graphic", "gr"
st = %WS_TabStop or %WS_CHILD or %WS_VISIBLE or %SS_OWNERDRAW
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "image", "img"
st = %WS_Child or %WS_Visible '{%SS_ICON} or {%SS_BITMAP} - if omitted or PowerBASIC will assign based on image type
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "imagex", "imgx"
st = %WS_Child or %WS_Visible '{%SS_ICON} or {%SS_BITMAP} - if omitted or PowerBASIC will assign based on image type
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "imgbutton", "imgb"
st = %WS_Child or %WS_Visible or %BS_PushButton or %WS_TABSTOP '{%BS_ICON} or {%BS_BITMAP} - if omitted or PowerBASIC will assign based on image type
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "imgbuttonx", "imgbx"
st = %WS_Child or %WS_Visible or %BS_PushButton or %WS_TABSTOP '{%BS_ICON} or {%BS_BITMAP} - if omitted or PowerBASIC will assign based on image type
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "label", "lbl"
st = %WS_Child or %WS_Visible or %SS_LEFT
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "line","ln"
st = %WS_Child or %WS_Visible or %SS_ETCHEDFRAME
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "listbox", "lb"
st = %WS_Child or %WS_Visible or %WS_TABSTOP or %LBS_SORT or %LBS_NOTIFY or %WS_VSCROLL
ste = %WS_Ex_ClientEdge or %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "listview", "lv"
st = %WS_Child or %WS_Visible or %WS_TABSTOP or %LVS_REPORT or %LVS_SHOWSELALWAYS
ste = %WS_EX_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "option", "opt"
st = %WS_Child or %WS_Visible or %WS_TABSTOP or %BS_AUTORADIOBUTTON
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
'%BS_Left, %BS_VCenter (neither found in WinSpy)
Case "progressbar", "pb"
st = %WS_Child or %WS_Visible or %WS_BORDER
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "scrollbar", "sb"
st = %WS_Child or %WS_Visible or %SBS_HORZ 'default is SBS_Horz unless w < h)
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "statusbar", "stat"
st = %WS_Child or %WS_Visible or %CCS_BOTTOM
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "tab", "tb"
st = %WS_Visible or %WS_CHILD or %WS_TABSTOP
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "textbox", "txt"
st = %WS_Child or %WS_Visible or %WS_TABSTOP or %WS_BORDER or %ES_AUTOHSCROLL or %ES_LEFT
ste = %WS_Ex_ClientEdge or %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "toolbar", "tb"
st = %WS_CHILD or %WS_VISIBLE or %WS_BORDER or %CCS_TOP or %TBSTYLE_FLAT
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
Case "treeview", "tv"
st = %WS_Child or %WS_Visible or %WS_TABSTOP or %TVS_HASBUTTONS or %TVS_LINESATROOT or %TVS_HASLINES or %TVS_SHOWSELALWAYS
ste = %WS_Ex_Left or %WS_Ex_LTRReading or %WS_Ex_RightScrollbar
End Select
End Sub
'gbs_01158
'Date: 03-25-2012
http://www.garybeene.com/sw/gbsnippets.htm