Catch the checkbox event

 

Hello all,

I tried to make a panel with a checkbox, It works well, but how can I catch the checkboxevent (is checked or not)

Some advices are apreciated, thank you
Greetings

//+------------------------------------------------------------------+
//|                                                  omino Panel.mq4 |
//|                        Copyright 2023, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2023, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

#include <Controls\Dialog.mqh>
#include <Controls\CheckBox.mqh>


#define PannelName " Trade Assistant"
#define PannelWidth 300
#define PannelHeight 400

#define C1_Name "C1"
#define C1_Width 170
#define C1_Height 180
#define C1_XDist 16
#define C1_YDist 150


CAppDialog Pannel;
CCheckBox  CheckBox1;



//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
     Pannel.Create(0,PannelName,0, 10,10,PannelWidth, PannelHeight);
     Pannel.Run();
         
     CheckBox1.Create(0,C1_Name,0,C1_XDist,C1_YDist,C1_Height,C1_Width);
     Pannel.Add(CheckBox1);
     CheckBox1.Text("Fixed Lot Size");
     CheckBox1.Checked(true);
     
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   //if(reason != REASON_CHARTCHANGE) {
   Pannel.Destroy(reason);
   //}
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
//---
   Pannel.ChartEvent(id,lparam,dparam,sparam);
   
 
  }
//+------------------------------------------------------------------+
 
Your topic has been moved to the section: MQL4 and MetaTrader 4
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Reason: