CLabel > Anchor = Right ?

 

I used to create labels, the library Label.mqh, with the class CLabel.

Where can I set the parameters of Anchor = Right ?

 
FinGeR:

I used to create labels, the library Label.mqh, with the class CLabel.

Where can I set the parameters of Anchor = Right ?

Good question. I don't have experience using it, but by looking at documentation (and code), seems to me that you don't have access to Anchor property with CLabel, this object is designed to be used with Panel and Dialogs and you have to use Left, Top, Right or Bottom to position it.

If you want to use a label object without Panel/Dialogs then you have CChartObjectLabel which provides you Anchor function.

#include <ChartObjects\ChartObjectsTxtControls.mqh>

CChartObjectLabel mylabel;
mylabel.Anchor(ANCHOR_RIGHT);
Anyway you have always the possibility to create your own class derived from CLabel and add the Anchor property.
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types - Documentation on MQL5
 
Thanks.
Reason: