<AI-slop removed by moderator>
Thank you for your response...but I've already tried and does not work.
Here below very simple code
//+------------------------------------------------------------------+ //| MOSTRANASCONDI.mq4 | //| LC 2025 | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "LC 2025" #property link "https://www.mql5.com" #property version "1.00" #property strict #include <Controls\Button.mqh> CButton ButtonTest; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- ButtonTest.Create(0,"Close",0,20,42,100,60); ButtonTest.Text ("Test Close"); return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- ButtonTest.Disable(); } //+------------------------------------------------------------------+ //| Tester function | //+------------------------------------------------------------------+ double OnTester() { //--- double ret=0.0; //--- //--- return(ret); } //+------------------------------------------------------------------+ //| ChartEvent function | //+------------------------------------------------------------------+ void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { //--- if(id==CHARTEVENT_OBJECT_CLICK) { if (sparam=="Close") {Print("ACTION");} } } //+------------------------------------------------------------------+
ButtonTest is disabled, but I can click it
Entdecken Sie neue Möglichkeiten des MetaTrader 5 mit MQL5 Gemeinschaft und Services
- 2026.07.27
- www.mql5.com
MQL5: eine Sprache von Handelsstrategien, eingebaut in die Handelsplattform MetaTrader 5, mit der man eigene Handelsroboter, technische Indikatoren, Skripte und Funktionsbibliotheken
INV2025 #:
...
Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!

Thank you.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Dear Community,
I've read all Doc about CButton and it seems to me, there is non built in method to perform following task
1) create CButton
2) CButton should be visible but not clickable at the beginning.
Any idea, how to perform this?