I'm refreshing this topic. Using Disable() on CCheckbox is not working as expected. Although call returns true checkbox is still enabled and clickable. Is this a standard library error or something else?
--- EDIT
I checked that flag WND_STATE_FLAG_ENABLE is properly reset on the object as a result of using Disable() - seems like Disable() is working properly but the flag itself is not working.
Hi,
Under some conditions, I want to disable a CheckBox. So I use the following code:
CCheckBox checkbox;
checkbox.Disable() ;
I have tried also this:
checkbox.Deactivate();
but the checkbox still be Active and the user can check/uncheck it.
Is it a bug of MT4 or my code is wrong?
thanks
This is a bug in library, I solve this by use event on check box button click and keep value if check box clicked, like below code:
if(id==CHARTEVENT_OBJECT_CLICK && sparam == "TimeControlCheckBoxSettingPanelButton") { Print("click on time control check box"); if(timeControl) timeControlValueCheckBox_terminalPanel.Checked(true); else timeControlValueCheckBox_terminalPanel.Checked(false); }
Your code | if(timeControl) timeControlValueCheckBox_terminalPanel.Checked(true); else timeControlValueCheckBox_terminalPanel.Checked(false); |
Simplified | timeControlValueCheckBox_terminalPanel.Checked(timeControl); |
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
Under some conditions, I want to disable a CheckBox. So I use the following code:
CCheckBox checkbox;
checkbox.Disable() ;
I have tried also this:
checkbox.Deactivate();
but the checkbox still be Active and the user can check/uncheck it.
Is it a bug of MT4 or my code is wrong?
thanks