You can always "do nothing" in the "OnChartEvent" function when the button is clicked under those conditions, controlling what's happening. All clicks will be ignored. Something like...
void OnChartEvent(const int id, // Event identifier const long &lparam, // Event parameter of long type const double &dparam, // Event parameter of double type const string &sparam) { // Event parameter of string type // The mouse has been clicked on the graphic object if(id == CHARTEVENT_OBJECT_CLICK) { // My button if(sparam == MY_BUTTON_NAME) { if(MyCondition()) //Do something else //Do something else } } }
You can always "do nothing" in the "OnChartEvent" function when the button is clicked under those conditions, controlling what's happening. All clicks will be ignored. Something like...
Hi, thanks for that.
I should have been more explicit because it is more of a visual thing. By the time you get to perform any processing, the button visual has already changed.
Hi, thanks for that.
I should have been more explicit because it is more of a visual thing. By the time you get to perform any processing, the button visual has already changed.
Not necessarily. Only if you add some background, etc. You control the background color and the font. Or I'm not understanding your issue. Some screenshots, maybe?
Not necessarily. Only if you add some background, etc. You control the background color and the font. Or I'm not understanding your issue. Some screenshots, maybe?
Here is an image where I have clicked the minus (-) button on the image...
The value does not go below 0.25%, so when it hits this value, I want to disable the button. The image you can see was captured by setting a break point in the debugger. Had I not set a break point then the code would have reset the button state, returning the image to this...
So basically, MT5 is processing the button click visuals before allowing any user code to perform any button click processing. What I would like to do is to totally disable the button so that nothing happens when you click on the button.
Hope that helps
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have created a new button object using...
There are certain instances where I would like to disable this button, so is it possible to disable this button object so that it cannot be clicked?
So far I can only see 2 options...
Am I overlooking something, or are these my only options?