texcs81:
Hello guys, I made a square with a white background with the following code
but I can not write over it so it's a background of what I write
// function int CreateBackground (string backName, string text, int Bfontsize, int LabelCorner, int xB, int yB, color clr) { if(ObjectFind(backName) == -1){ ObjectCreate(backName, OBJ_LABEL, 0, 0, 0, 0, 0);} ObjectSetText(backName, text, Bfontsize, "Webdings"); ObjectSet(backName, OBJPROP_CORNER, LabelCorner); ObjectSet(backName, OBJPROP_BACK, false); ObjectSet(backName, OBJPROP_XDISTANCE, xB); ObjectSet(backName, OBJPROP_YDISTANCE, yB ); ObjectSet(backName, OBJPROP_COLOR, clr); //ObjectSetText(backName, "ciao", 1, "Times New Roman"); } int start() { CreateBackground("BgroundGG","Ciao",10,3,200,300,White); return(0); }.
texcs81: I made a square with a white background with the following code
| You did not. You created some white text. No square, no background. //+------------------------------------------------------------------+ //| Create rectangle label | //+------------------------------------------------------------------+ void create_rect(string name, int offX, int offY, int width, int height, int line_width=1){ ObjectCreate(0, name, OBJ_RECTANGLE_LABEL, 0, 0, 0); ObjectSetInteger(0, name, OBJPROP_XDISTANCE, orgX + offX); ObjectSetInteger(0, name, OBJPROP_YDISTANCE, orgY + offY); ObjectSetInteger(0, name, OBJPROP_XSIZE, width); ObjectSetInteger(0, name, OBJPROP_YSIZE, height); ObjectSetInteger(0, name, OBJPROP_BGCOLOR, ColorBox); ObjectSetInteger(0, name, OBJPROP_BORDER_TYPE, BORDER_FLAT); ObjectSetInteger(0, name, OBJPROP_CORNER, CORNER_LEFT_UPPER); ObjectSetInteger(0, name, OBJPROP_COLOR, ColorText); ObjectSetInteger(0, name, OBJPROP_STYLE, STYLE_SOLID); ObjectSetInteger(0, name, OBJPROP_WIDTH, line_width); ObjectSetInteger(0, name, OBJPROP_BACK, false); ObjectSetInteger(0, name, OBJPROP_SELECTABLE, false); ObjectSetInteger(0, name, OBJPROP_SELECTED, false); ObjectSetInteger(0, name, OBJPROP_HIDDEN, false); ObjectSetInteger(0, name, OBJPROP_ZORDER, Priority_Box); } // create_rect //+------------------------------------------------------------------+ //| Create label. | //+------------------------------------------------------------------+ void create_label(string name, int offX, int offY, string text, string tip, color clr=clrNONE, int font_size=10){ if(clr == clrNONE) clr = ColorText; ObjectCreate(name, OBJ_LABEL, 0, 0, 0); ObjectSetInteger(0, name, OBJPROP_XDISTANCE, orgX + offX); ObjectSetInteger(0, name, OBJPROP_YDISTANCE, orgY + offY); ObjectSetInteger(0, name, OBJPROP_SELECTABLE, false); ObjectSetText(name, text, font_size, "Courier New", clr); ObjectSetString(0, name, OBJPROP_TOOLTIP, tip); } // create_label From my GUI: Indicators: 'Money Manager Graphic Tool' indicator by 'takycard' Forum - Page 5 |

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 guys, I made a square with a white background with the following code
but I can not write over it so it's a background of what I write