Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Eliminating controls on some but not all tabs
#1
Is there a way to show a control like (ComboBox) in tab one and two but not in three?
I have a combo box that I need, with the same changing information in it, in tab one and two but not the other tabs.

Example:

Function dialog_with_tab_control
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("dialog_with_tab_control" &dialog_with_tab_control)) ret

;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 265 163 "Form"
show this ComboBox on page 0 and 1 but not 2
;1002 ComboBox 0x54230A42 0x0 58 88 96 213 ""
;1001 Static 0x44020000 0x4 94 60 48 13 "Page0"
;1101 Static 0x44020000 0x4 104 62 48 13 "Page1"
;1201 Static 0x44020000 0x4 110 70 48 13 "Page2"
;1 Button 0x54030001 0x4 142 146 48 14 "OK"
;2 Button 0x54030000 0x4 192 146 48 14 "Cancel"
;4 Button 0x54032000 0x4 242 146 18 14 "?"
;3 SysTabControl32 0x54000040 0x0 0 2 266 132 ""
;5 Static 0x54000010 0x20004 4 138 256 1 ""
;END DIALOG
;DIALOG EDITOR: "" 0x203000A "" "0" ""

type TCITEM mask dwState dwStateMask $pszText cchTextMax iImage lParam

ret
;messages
sel message
,case WM_INITDIALOG
,DT_Init(hDlg lParam)
,
,int htb=id(3 hDlg)
,TCITEM ti.mask=WINAPI.TCIF_TEXT
,ti.pszText="A"
,SendMessage htb WINAPI.TCM_INSERTITEMA 0 &ti
,ti.pszText="B"
,SendMessage htb WINAPI.TCM_INSERTITEMA 1 &ti
,ti.pszText="C"
,SendMessage htb WINAPI.TCM_INSERTITEMA 2 &ti
,
,goto g11
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
,case WM_NOTIFY goto messages3
ret
;messages2
sel wParam
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1
;messages3
NMHDR* nh=+lParam
sel nh.code
,case WINAPI.TCN_SELCHANGE
,_i=SendMessage(nh.hwndFrom WINAPI.TCM_GETCURSEL 0 0)
,;g11
,DT_Page hDlg _i
#2
Move the control(s) to some unused page, eg 80.

;9002 ComboBox 0x54230A42 0x0 58 88 96 213 ""

With DT_Page use third argument like
,DT_Page hDlg _i "(0 80) (1 80)"

In page 0 it shows page 0 and 80. In page 1 it shows page 1 and 80.
#3
So sweet!

Thank You


Forum Jump:


Users browsing this thread: 1 Guest(s)