disable/enable toolbar buttons in a dialog
-
can anyone tell me the proper way to disable and enable them within a dialog i know ive posted this thread 2 times already but neither asnwer worked thanks for any help
-
can anyone tell me the proper way to disable and enable them within a dialog i know ive posted this thread 2 times already but neither asnwer worked thanks for any help
send TB_SETBUTTONINFO with sendmessage... TBBUTTONINFO.fsState = TBSTATE_INDETERMINATE; Don't try it, just do it! ;-)
-
send TB_SETBUTTONINFO with sendmessage... TBBUTTONINFO.fsState = TBSTATE_INDETERMINATE; Don't try it, just do it! ;-)
and how do i send that to send message and how do i tell it wich buttons to disbale/enable?
-
can anyone tell me the proper way to disable and enable them within a dialog i know ive posted this thread 2 times already but neither asnwer worked thanks for any help
thats how its done if you tool bar control is a member of your dlg class m_Tool.SetButtonStyle(1, TBBS_DISABLED); m_Tool.SetButtonStyle(1, TBSTATE_ENABLED);
-
can anyone tell me the proper way to disable and enable them within a dialog i know ive posted this thread 2 times already but neither asnwer worked thanks for any help
- If you have a mapped variable for the dialog item: 1A) If it is a static item created with the visual editor: itemmappedvariable.EnableWindow(BOOL); 1B) If it is a dynamic item created on the fly: itemmappedvariable->EnableWindow(BOOL); where BOOL is TRUE or FALSE. Setting to FALSE makes the item greyed out and not selectable by the user, which is what most people mean by disabled. 2) If you want the dialog item to completely disapear, you use: 2A) itemmappedvariable.ShowWindow(var); 2B) itemmappedvariable->ShowWindow(var); where var=SW_SHOW to make it visible var=SW_HIDE to make it disapear. If you don't know what a mapped variable is, either: 1) Ggo to the item in the dialog editor. Click on the dialog item, Right click, select create variable. Fill in the name, hit OK. This makes all the coding changes so that you can use the A syntax above. If you search your dialog .h and .cpp you can see the simple changes and do others by hand. Pay attention to the lack of trailing semicolons if you do. 2) You can also use GetDlgItem(IDC_WHATEVER)->EnableWindow(BOOL) or GetDlgItem(IDC_whatever)->ShowWindow(var). Less efficient this way if you do it a lot. Good luck! tim Founder, TMurgent Technologies www.tmurgent.com tmangan@tmurgent.com