How to increase Font size of Comment()?

 
Is there a way to increase the fonts of Comment()?
 
No way. Use TextLabel object
 

you can ,use this function:

void CommentLab(string CommentText)  
{
   string CommentLabel, label_name;
   int CommentIndex = 0;
  
   label_name = "Bid_Offer"; 

   if (CommentText == "")
   {
      //  delete all Comment texts
      while(ObjectFind(0,label_name) >= 0)
      {
         ObjectDelete(0,label_name);
         CommentIndex++;
      }
//    return;
   }
  

//    Print("CommentText: ",CommentText);
  
      ObjectCreate(0,label_name,OBJ_LABEL,0,0,0);           
      ObjectSetInteger(0,label_name, OBJPROP_CORNER, 0);
      //--- set X coordinate
      ObjectSetInteger(0,label_name,OBJPROP_XDISTANCE,20);
      //--- set Y coordinate
      ObjectSetInteger(0,label_name,OBJPROP_YDISTANCE,50);
      //--- define text color
      ObjectSetInteger(0,label_name,OBJPROP_COLOR,clrGoldenrod);
      //--- define text for object Label
      ObjectSetString(0,label_name,OBJPROP_TEXT,CommentText);
      //--- define font
      ObjectSetString(0,label_name,OBJPROP_FONT,"Arial");
      //--- define font size
      ObjectSetInteger(0,label_name,OBJPROP_FONTSIZE,18);
      //--- 45 degrees rotation clockwise
//    ObjectSetDouble(0,label_name,OBJPROP_ANGLE,-45);
      //--- disable for mouse selecting
      ObjectSetInteger(0,label_name,OBJPROP_SELECTABLE,true);
      //--- draw it on the chart
      ChartRedraw(0);                                     
  
}
 

Please use the </> button to insert your code.


 
Eleni Anna Branou:

Please use the </> button to insert your code.


void CommentLab(string CommentText)  
{
   string CommentLabel, label_name;
   int CommentIndex = 0;
  
   label_name = "Bid_Offer"; 

   if (CommentText == "")
   {
      //  delete all Comment texts
      while(ObjectFind(0,label_name) >= 0)
      {
         ObjectDelete(0,label_name);
         CommentIndex++;
      }
//    return;
   }
  

//    Print("CommentText: ",CommentText);
  
      ObjectCreate(0,label_name,OBJ_LABEL,0,0,0);           
      ObjectSetInteger(0,label_name, OBJPROP_CORNER, 0);
      //--- set X coordinate
      ObjectSetInteger(0,label_name,OBJPROP_XDISTANCE,20);
      //--- set Y coordinate
      ObjectSetInteger(0,label_name,OBJPROP_YDISTANCE,50);
      //--- define text color
      ObjectSetInteger(0,label_name,OBJPROP_COLOR,clrGoldenrod);
      //--- define text for object Label
      ObjectSetString(0,label_name,OBJPROP_TEXT,CommentText);
      //--- define font
      ObjectSetString(0,label_name,OBJPROP_FONT,"Arial");
      //--- define font size
      ObjectSetInteger(0,label_name,OBJPROP_FONTSIZE,18);
      //--- 45 degrees rotation clockwise
//    ObjectSetDouble(0,label_name,OBJPROP_ANGLE,-45);
      //--- disable for mouse selecting
      ObjectSetInteger(0,label_name,OBJPROP_SELECTABLE,true);
      //--- draw it on the chart
      ChartRedraw(0);                                     
  
}

Thanks for this code :)

 
Abhay Agarwal #: you can ,use this function:
void CommentLab(string CommentText)  
{
   string CommentLabel, label_name;
   int CommentIndex = 0;
  
   label_name = "Bid_Offer"; 

   if (CommentText == "")
   {
      //  delete all Comment texts
      while(ObjectFind(0,label_name) >= 0)
      {
         ObjectDelete(0,label_name);
         CommentIndex++;
      }
//    return;
   }
  

//    Print("CommentText: ",CommentText);
  
      ObjectCreate(0,label_name,OBJ_LABEL,0,0,0);           
      ObjectSetInteger(0,label_name, OBJPROP_CORNER, 0);
      //--- set X coordinate
      ObjectSetInteger(0,label_name,OBJPROP_XDISTANCE,20);
      //--- set Y coordinate
      ObjectSetInteger(0,label_name,OBJPROP_YDISTANCE,50);
      //--- define text color
      ObjectSetInteger(0,label_name,OBJPROP_COLOR,clrGoldenrod);
      //--- define text for object Label
      ObjectSetString(0,label_name,OBJPROP_TEXT,CommentText);
      //--- define font
      ObjectSetString(0,label_name,OBJPROP_FONT,"Arial");
      //--- define font size
      ObjectSetInteger(0,label_name,OBJPROP_FONTSIZE,18);
      //--- 45 degrees rotation clockwise
//    ObjectSetDouble(0,label_name,OBJPROP_ANGLE,-45);
      //--- disable for mouse selecting
      ObjectSetInteger(0,label_name,OBJPROP_SELECTABLE,true);
      //--- draw it on the chart
      ChartRedraw(0);                                     
  
}

thanks . exactly what i needed. nice job


edit: if you want to create your comments in seprate lines, you have to edit code like this:

first you have to put numbers in your comments. like this: commentLab("1.comment");  and commentLab("2.comment");

then you define your ydistance as integer in global; int ydistance=200;

then you replace the code of function with this one:

void CommentLab(string CommentText)  
{
   string label_name;
   int CommentIndex = 0;
  
   label_name = "CheckList"; 

   if (CommentText == "")
   {
      //  delete all Comment texts
      while(ObjectFind(0,label_name) >= 0)
      {
         ObjectDelete(0,label_name);
         CommentIndex++;
     }
//    return;
   }

  for(int i=1;i<10;i++){
  if(StringFind(CommentText,IntegerToString(i),0)!=-1){
  ydistance+=20;
      ObjectCreate(0,label_name+i,OBJ_LABEL,0,0,0);           
      ObjectSetInteger(0,label_name+i, OBJPROP_CORNER, 0);
      //--- set X coordinate
      ObjectSetInteger(0,label_name+i,OBJPROP_XDISTANCE,10);
      //--- set Y coordinate
      ObjectSetInteger(0,label_name+i,OBJPROP_YDISTANCE,ydistance);
      //--- define text color
      ObjectSetInteger(0,label_name+i,OBJPROP_COLOR,clrCyan);
      //--- define text for object Label
      ObjectSetString(0,label_name+i,OBJPROP_TEXT,CommentText);
      //--- define font
      ObjectSetString(0,label_name+i,OBJPROP_FONT,"Arial");
      //--- define font size
      ObjectSetInteger(0,label_name+i,OBJPROP_FONTSIZE,10);
      //--- 45 degrees rotation clockwise
//    ObjectSetDouble(0,label_name,OBJPROP_ANGLE,-45);
      //--- disable for mouse selecting
      ObjectSetInteger(0,label_name+i,OBJPROP_SELECTABLE,true);
      //--- draw it on the chart
      ChartRedraw(0);  
      }   
      }                                
  
}