CChartObjectRectLabel question

Back to topics list To post a new topic, please log in or register
avatar
147
nondisclosure 2016.01.15 06:02
 

Note: If this post is duplicated, sorry.  I'm pc crashed while I was doing it.

Isn't an object of this type supposed to support text in it?  My code draws the box just fine.  But no text shows up inside.  I'm pretty sure I'm missing something.  Anyone know?

#property strict
#include <ChartObjects\ChartObjectsTxtControls.mqh>
CChartObjectRectLabel rectLabel;

int OnInit()
  {
   return(INIT_SUCCEEDED);
  }

void OnDeinit(const int reason)
  {

  }

void OnTick()
  {
   rectLabel.Create(0,"rlabel",0,75,75,100,100);
   rectLabel.BackColor(clrBlack);
   rectLabel.Hidden(false);
   rectLabel.SetString(OBJPROP_TEXT,"My Box!");
   rectLabel.Color(clrYellow);
  }
avatar
Moderator
3418
GumRai 2016.01.15 07:41 #
 

The name suggests that it would also have text, but it doesn't.

At least I don't know how to display text. I tried at first because I made the same logical assumption as you.

It's just really useful as a panel background and you can place ordinary labels or other objects on top of it 

avatar
736
honest_knave 2016.01.15 08:44 #
 

Ordinarily, a rectangle label object doesn't support text (but I've not experimented with it using ChartObjects).

The alternative is to use OBJ_BUTTON. This allows you to set a background color, a border color and text all in one object. 

Back to topics list  

To add comments, please log in or register