It is possible to add controls to CPanel?

 

Hello,


I have a dialog and I added to this dialog a CPanel control: . everything is OK.

Now I would like to add  controls to cpanel so that when I hide/show the cpanel  all controls disappear/appear.


How to to do? No ADD function for cpanel......


Thanks

MT4 build 765
 

There is example indicator in the indicators folder.

In Metaeditor look into Indicators\Examples\SimplePanel

 

Thanks... but the question is slight different...

I want to add  to a dialog another control (CPanel) and then add controls to CPanel object,

in pseudo-code:

dialog=CreateDialog()

button=CreateButton()

dialog.Add(button)  ->  my dialog with button

cpanel=CreateCpanel()

button2=CreateButton2()

cpanel.Add(button2)  --> my panel with button2

dialog.Add(Cpanel)  my dialog with   button + one panel with  button2; if I hide cpanel I hide button2 too!!

 

Did you try that with CWndContainer class instead of CPanel?

CWndContainer has Add() function.

Also, CDialog is derived from that class.

I never tried that, but it may work. 

Reason: