Syntax
Public Function ObjectSetText(chartID As Long, name As String, font_Size As Integer, Optional font As String = "", Optional text_color As Long = 0) As Boolean
Description
This function is used to change the text propertyfor thetext object and labelobject.
Parameters
Key | Description |
chartID | Chart identifier, 0 mean the current chart, the value of type Long. |
name | Object key value of type String. |
font_Size | Font size, the value of type Integer. |
font | Font type name, Optional value of type String. |
text_color | OneofRGB color value, Optional value of type Long. |
Return value
Returns true if result successful. Otherwise, it returns false.To get the detailed error information, call GetlastError() function.
Sample
Dim objTextDim objIDDim fontSizeDim XPosDim YPosPublic Sub main()fontSize = 15objColor = RGBColor(50,50,100)If AccountInfoInteger(ACCOUNT_LOGIN) = -1 Then ' Check if account is selectedAlertMessage "Please select an account first" ElseobjID = "lblText" ' ID of the label objectXPos = 10 ' X position on chartYPos = 180 ' Y position on chartobjText="Text goes here." ' Sets the text of the label. CreateObjectLabel 0,0,CSTR(objID),CINT(XPos),CINT(YPos),objText 'Creates the label with the selected parametersObjectSetText 0, CSTR(objID),CINT(fontSize),,CLNG(objColor) ' Sets the label properties.End IfEnd Sub
See Also