Use Wingdings font?
Please do not reply inside quoted text box.
ObjectSetText(obname,CharToStr(233),ArrowFontSize,"Wingdings",Colour);
ObjectSetString(0,obname,OBJPROP_FONT,"Wingdings");
ObjectSetInteger(0,obname,OBJPROP_COLOR,Colour);
Variations of the above should suit you although i have never used wingdings font for buttons as far as I can remember.
Obviously use your own variables and whatever wingding code you require.
Please do not reply inside quoted text box.
ObjectSetText(obname,CharToStr(233),ArrowFontSize,"Wingdings",Colour);
ObjectSetString(0,obname,OBJPROP_FONT,"Wingdings");
ObjectSetInteger(0,obname,OBJPROP_COLOR,Colour);
Variations of the above should suit you although i have never used wingdings font for buttons as far as I can remember.
Obviously use your own variables and whatever wingding code you require.
Sorry
I corrected the code I can not THANKS
Sorry
I corrected the code I can not THANKS
ObjectCreate(chart,nometasto,OBJ_BUTTON,0,0,0,0); ObjectSetInteger(chart,nometasto,OBJPROP_CORNER,CORNER_RIGHT_UPPER); ObjectSetInteger(chart,nometasto,OBJPROP_ANCHOR,ANCHOR_RIGHT_UPPER); ObjectSetInteger(chart,nometasto,OBJPROP_XDISTANCE,x); ObjectSetInteger(chart,nometasto,OBJPROP_YDISTANCE,y); ObjectSetInteger(chart,nometasto,OBJPROP_XSIZE,A); ObjectSetInteger(chart,nometasto,OBJPROP_YSIZE,B); ObjectSetInteger(chart,nometasto,OBJPROP_BGCOLOR,col); //ObjectSetString(chart,nometasto,OBJPROP_TEXT,testo); ObjectSetString(chart,nometasto,OBJPROP_FONT,"Arial"); ObjectSetInteger(chart,nometasto,OBJPROP_FONTSIZE,10); ObjectSetInteger(chart,nometasto,OBJPROP_COLOR,clrWhite); ObjectSetInteger(chart,nometasto,OBJPROP_STATE,false); ObjectSetInteger(chart,nometasto,OBJPROP_BACK,false); ObjectSetText(nometasto,CharToStr(74),30,"Wingdings",Gold);
I have corrected but not SMILE OBJ_ARROW code 74
Thanks
For some reason
ObjectSetText(nometasto,CharToStr(74),30,"Wingdings",Gold);
will not work properly with Buttons or Edit objects.
You must modify individual parameters.
//ObjectSetString(chart,nometasto,OBJPROP_FONT,"Arial");
ObjectSetString(chart,nometasto,OBJPROP_FONT,"Wingdings");
//ObjectSetInteger(chart,nometasto,OBJPROP_FONTSIZE,10);
ObjectSetInteger(chart,nometasto,OBJPROP_FONTSIZE,30);
//ObjectSetInteger(chart,nometasto,OBJPROP_COLOR,clrWhite);
ObjectSetInteger(chart,nometasto,OBJPROP_COLOR,clrGold);
Also note
ObjectSetInteger(chart,nometasto,OBJPROP_ANCHOR,ANCHOR_RIGHT_UPPER); //Does not work with buttons, will always be LEFT_UPPER
It looks like you're trying to put your button in the upper right-hand corner. Here is an example script of how to do it. You'll also want to add a move function so the button moves when you resize the chart window.
#property strict #include <Controls\Button.mqh> //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- CButton b; int x = (int)ChartGetInteger(0,CHART_WIDTH_IN_PIXELS); int y = (int)ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS); b.Create(0,"Button",0,x-53,2,x-3,52); b.Font("Wingdings"); b.FontSize(15); b.Color(clrLimeGreen); b.Text(CharToStr(233)); Sleep(10000); } //+------------------------------------------------------------------+
It looks like you're trying to put your button in the upper right-hand corner. Here is an example script of how to do it. You'll also want to add a move function so the button moves when you resize the chart window.
Why?
Claudio's code includes
ObjectSetInteger(chart,nometasto,OBJPROP_CORNER,CORNER_RIGHT_UPPER);
so it will always be in the position related to the top right corner when the chart button is re-sized. It is just a matter of including XSIZE in XDISTANCE.
Why?
Claudio's code includes
so it will always be in the position related to the top right corner when the chart button is re-sized. It is just a matter of including XSIZE in XDISTANCE.
Oh.. right on. I didn't realize that corner also applied to buttons. I just realized I've been using the wrong class...
#include <ChartObjects\ChartObjectsTxtControls.mqh> void OnStart() { //--- CChartObjectButton b; b.Create(0,"Button",0,0,0,50,50); b.Corner(CORNER_RIGHT_UPPER); b.X_Distance(50); b.Font("Wingdings"); b.FontSize(15); b.Color(clrLimeGreen); b.Description(CharToStr(233)); Sleep(10000); } //+------------------------------------------------------------------+

- 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 have a question ?
Is OBJ_BUTTON possible to include in the OBJ_ARROW text? And if so how?
Thanks