Although I have disabled a CheckBox it works

To add comments, please log in or register
thakas
17
thakas  

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

erne100
6
erne100  
The same here! I cannot disable Edit Control. Tried Disable() and Deactivate() and the control is still active and user can write into it.
erne100
6
erne100  
I've finally found the solution. At least for the edit control. You need to use ReadOnly() method instead of Disable() or Deactivate(). Additionally you can change the background color of the control by using ColorBackground() method.
Marcin Madrzak
478
Marcin Madrzak  

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.

To add comments, please log in or register