They are layered in the order they are created. So if you need to bring an object to the top then you need to destroy and recreate it or check the creation order from the start. Here is a quick demo script.
#property strict #include <ChartObjects\ChartObjectsShapes.mqh> #include <ChartObjects\ChartObjectsTxtControls.mqh> class MyRect : public CChartObjectRectLabel { public: bool Create(){ return( CChartObjectRectLabel::Create(0, "rect", 0, 0, 0, 50, 50) && this.Color(clrWhiteSmoke) ); } }; class MyLabel : public CChartObjectLabel { public: bool Create(){ return( CChartObjectLabel::Create(0, "label", 0, 0, 0) && this.Description("Created behind") && this.FontSize(15) && this.Color(clrYellow) ); } bool bring_to_top(){ this.Delete(); return this.Create(); } }; void OnStart() { MyLabel label; MyRect rect; label.Create(); rect.Create(); ChartRedraw(); Sleep(3000); label.bring_to_top(); label.Description("Brought to top"); ChartRedraw(); Sleep(3000);
nicholi shen:
They are layered in the order they are created. So if you need to bring an object to the top then you need to destroy and recreate it or check the creation order from the start. Here is a quick demo script.
Thanks for your help! :) & knowledge of CObject class you gave me!
Finally, I made it myself ... haha!
have a good day Friend.
regard,

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
hello everyone! &
How to code a label object to stay on top of another label objects as will? Please
Im new to mql4. Recently, I read alot of object properties in mql articles & searched for solutions on google. unfortunately, I cant find out how to code a label object to stay on top of another label objects as will :/
I found some indis out there & the coders did it very well :)
Could anyone give me some idea? please
Have a good weekend & Thanks in advance!
//--
What I want is
1. my label object always stays on some another labels which may belong to other ex4.indicators?
2.to kown the rules/functions... for priority displaying (label)objects on chart?
....my broblem : I want my label object (SOME TEXT) to stay on top of a lable object of another indicator (white lable).
attached is my code: