Download MetaTrader 5
To add comments, please log in or register
Do you need a programmer? Make an order to let the developer find you!
Mohammad Mohi
220
Mohammad Mohi 2016.08.05 22:26 
I need to change background color of my Panel derived from CAppDialog, but since m_background is a private member of CDialog, I can't access it and change the color with the function ColorBackground(). I appritiate any help.
Vladimir Karputov
Moderator
42469
Vladimir Karputov 2016.08.06 16:02  
Mohammad Mohi:
I need to change background color of my Panel derived from CAppDialog, but since m_background is a private member of CDialog, I can't access it and change the color with the function ColorBackground(). I appritiate any help.

Just create your own panel "CPanel" ...

This example is based on a standard of Example ...\MQL5\Experts\Examples\Controls\

Files:
Controls.mq5 3 kb
Mohammad Mohi
220
Mohammad Mohi 2016.08.07 15:29  
Karputov Vladimir:

Just create your own panel "CPanel" ...

This example is based on a standard of Example ...\MQL5\Experts\Examples\Controls\

Thanks for reply, But I want to change the main CAppDialog background color or caption bar, not the controls on it.
Vladimir Karputov
Moderator
42469
Vladimir Karputov 2016.08.07 15:39  
Mohammad Mohi:
Thanks for reply, But I want to change the main CAppDialog background color or caption bar, not the controls on it.
Extend my plate - and you can change the background color :). By CAppDialog not have access.
Mohammad Mohi
220
Mohammad Mohi 2016.08.07 21:20  
Karputov Vladimir:
Extend my plate - and you can change the background color :). By CAppDialog not have access.
That's fine, I know that way but I need to code as less as possible, and want to benefit from further developments made to the Standard Library, that's why I want to try a native way rather than extending, I believe one should be able to change the Panel colors within the inherited class itself.
Ernst Van Der Merwe
4613
Ernst Van Der Merwe 2016.08.08 11:49  
The simplest way would be to move m_background to protected: but then the code would have to be changed when the class is updated.
/
To add comments, please log in or register