More Simple Creation of Labels

 

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

 
shawnmstout:

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...

Reason: