How to hide a CLabel

 

Hello to everybody;

I am new to MQL5 and I am trying to experience in making a simple form, for now.

My goal is to hide a CLabel, once c

reated it and added to the form.

In the Create() method

bool CFormDialog::Create(long chart,string name,int subwin,int x1,int y1,int x2,int y2) {
   CAppDialog::Create(chart,name,subwin,x1,y1,x2,y2);

  
   myLabel.Create(chart,"myLabel",subwin,40,30,100,20);
   Add(myLabel);
   myLabel.Text("myLabel");
}

and the CLabel is created and added to the form, but when I try to call the method Hide()

myLabel.Hide()

anythyng happens and the CLabel myLabel does not disappear, as I want.

Somebody could help me, pls ?

 
DeltaElectronics:

Hello to everybody;

I am new to MQL5 and I am trying to experience in making a simple form, for now.

My goal is to hide a CLabel, once c

reated it and added to the form.

In the Create() method

and the CLabel is created and added to the form, but when I try to call the method Hide()

anythyng happens and the CLabel myLabel does not disappear, as I want.

Somebody could help me, pls ?

Help CLabel.

add line:

//+------------------------------------------------------------------+
//| Create the "CLabel"                                              |
//+------------------------------------------------------------------+
bool CControlsDialog::CreateLabel(void)
  {
//--- coordinates
   int x1=INDENT_RIGHT;
   int y1=INDENT_TOP+CONTROLS_GAP_Y;
   int x2=x1+100;
   int y2=y1+20;
//--- create
   if(!m_label.Create(m_chart_id,m_name+"Label",m_subwin,x1,y1,x2,y2))
      return(false);
   if(!m_label.Text("Label"))
      return(false);
   if(!Add(m_label))
      return(false);
   m_label.Hide();
//--- succeed
   return(true);
  }
Documentation on MQL5: Standard Library / Panels and Dialogs / CLabel
Documentation on MQL5: Standard Library / Panels and Dialogs / CLabel
  • www.mql5.com
//|                                                ControlsLabel.mq5 | //|                        Copyright 2017, MetaQuotes Software Corp. | //|                                             https://www.mql5.com | //| defines                                                          |  INDENT_LEFT                         (11)      ...
Reason: