i got tired of always typing out all the values for creating a label, so i created a function for it, then you can just add in your own code into it
here is the code
//===========================Label Function================================
void fLabel(string lblname,int x,int y,string window,
string txt,int size,string font,color txtcolor){
ObjectCreate(lblname, OBJ_LABEL, WindowFind(window), 0, 0);
ObjectSet(lblname, OBJPROP_CORNER, 0);
ObjectSet(lblname, OBJPROP_XDISTANCE, x);
ObjectSet(lblname, OBJPROP_YDISTANCE, y);
ObjectSetText(lblname,txt,size,font, txtcolor);
return(0);
}
now to call it you simply write it like thise
fLabel("Balance",100,0,"Account_Info",BalanceStr,10,"Arial",MainColor);
and thats it
ill explain variables
they go like this
fLabel(label Name, x position, y position, window to put it in, text or value that you will be showing, font size, font type, fontcolor)
hope this helps someone
Thanks Bro...
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
i got tired of always typing out all the values for creating a label, so i created a function for it, then you can just add in your own code into it
here is the code
//===========================Label Function================================
void fLabel(string lblname,int x,int y,string window,
string txt,int size,string font,color txtcolor){
ObjectCreate(lblname, OBJ_LABEL, WindowFind(window), 0, 0);
ObjectSet(lblname, OBJPROP_CORNER, 0);
ObjectSet(lblname, OBJPROP_XDISTANCE, x);
ObjectSet(lblname, OBJPROP_YDISTANCE, y);
ObjectSetText(lblname,txt,size,font, txtcolor);
return(0);
}
now to call it you simply write it like thise
fLabel("Balance",100,0,"Account_Info",BalanceStr,10,"Arial",MainColor);
and thats it
ill explain variables
they go like this
fLabel(label Name, x position, y position, window to put it in, text or value that you will be showing, font size, font type, fontcolor)
hope this helps someone