Syntax
Public Function SetListViewSettings(formID As String, ListName As String, prop_Id As NUM_GUI_LIST_VIEW_SETTINGS, prop_Value As Variant, Optional listItemIndex As Integer) As Boolean
Description
This function is used to set settings to a specific list view according to a given property Id.
Parameters
Key | Description |
formId | Form identifier, must be a number greater than 3000 and less than 10,000. |
ListName | List identifier, value of type String. |
Prop_Id | Value can be one of the ENUM_GUI_LIST_VIEW_SETTINGS |
Prop_Value | The value of the specified property |
listItemIndex | Optional attribute to indicate the list item index, value of type Integer. |
Return value
Returns true if the list view or list view item has been sat to the specified property. Otherwise, returns false. In order to get an error, call GetLastError() function.
Sample
Public Sub Main()Dim frmID frmID = 3600CreateVTLForm Clng(frmID) , false, "CAPTION"CreateVTLControl Cstr(frmID) , "MyList", GUI_LIST_VIEWSetGUIObject CSTR(frmID),CSTR("MyList"),GUI_PROPERTY_BACK_COLOR,Clng(RGB(190,101,190))SetGUIObject CSTR(frmID),"",GUI_PROPERTY_HEIGHT, 6000SetGUIObject CSTR(frmID),"",GUI_PROPERTY_WIDTH, 13000SetGUIObject CSTR(frmID),"",GUI_PROPERTY_LEFT, 100SetGUIObject CSTR(frmID),"",GUI_PROPERTY_TOP, 100SetGUIObject CSTR(frmID),CSTR("MyList"),GUI_PROPERTY_HEIGHT, 2000SetGUIObject CSTR(frmID),CSTR("MyList"),GUI_PROPERTY_WIDTH,12000SetGUIObject CSTR(frmID),CSTR("MyList"),GUI_PROPERTY_TOP,400for i = 1 to PositionTotal SetListViewAction CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_LISTITEM, Cstr(i)nextSetListViewAction CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_COLUMN, "1","TicketNo"SetListViewAction CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_COLUMN, "2","Date"SetListViewAction CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_COLUMN, "3","Type"SetListViewAction CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_COLUMN, "4","Amount"SetListViewAction CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_COLUMN, "5","Sympol"SetListViewAction CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_COLUMN, "6","OpenPrice"SetListViewAction CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_COLUMN, "7","S/L"SetListViewAction CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_COLUMN, "8","T/P"SetListViewAction CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_COLUMN, "9","Commision"SetListViewAction CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_COLUMN, "10","Interest"SetListViewSettings CSTR(frmID), CSTR("MyList"),LIST_VIEW_FULL_ROW_SELECT,trueSetListViewSettings CSTR(frmID), CSTR("MyList"),LIST_VIEW_STYLE,3SetListViewSettings CSTR(frmID), CSTR("MyList"),LIST_VIEW_MULTI_SELECT,trueSetListViewSettings CSTR(frmID), CSTR("MyList"),LIST_VIEW_FLAT_SCROLLBAR,trueSetListViewSettings CSTR(frmID), CSTR("MyList"),LIST_VIEW_SORTED,trueSetListViewSettings CSTR(frmID), CSTR("MyList"),LIST_VIEW_ALLOW_COLUMN_REORDER,truefor j = 1 to 10SetListViewSettings CSTR(frmID), CSTR("MyList"),LIST_VIEW_COLUMN_WIDTH,1200,Cint(j)nextDim ticketNoDim result Dim ticketSympolDim time1 Dim OpenPrice1Dim type1Dim typeStrDim SLDim TPDim CommDim Interestfor i=1 to PositionTotalticketNo = PositionGetTicket(cint (i)) PositionSelect(Clng (ticketNo))ticketNo = PositionGetTicket(cint (i)) time1 = GetPositionTime()type1 = GetPositionType()PositionGetDouble POSITION_SL,SLPositionGetDouble POSITION_TP,TPPositionGetDouble POSITION_COMMISSION,CommPositionGetDouble POSITION_SWAP,InterestSelect case type1 case 1typeStr = "buy" case -1typeStr = "sell" case 2typeStr = "buy stop" case -2typeStr = "sell stop"End SELECTPositionGetDouble POSITION_AMOUNT ,resultticketSympol = Cstr(PositionGetSymbol(Cint(i))) PositionGetDouble POSITION_PRICE_OPEN ,OpenPrice1SetListSubItem CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_SUBITEM, Cstr(i), Cstr(ticketNo),0SetListSubItem CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_SUBITEM, Cstr(i), Cstr(time1),1SetListSubItem CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_SUBITEM, Cstr(i), Cstr(typeStr),2SetListSubItem CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_SUBITEM, Cstr(i), Cstr(result),3SetListSubItem CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_SUBITEM, Cstr(i), Cstr(ticketSympol),4SetListSubItem CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_SUBITEM, Cstr(i), Cstr(OpenPrice1),5SetListSubItem CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_SUBITEM, Cstr(i), Cstr(SL),6SetListSubItem CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_SUBITEM, Cstr(i), Cstr(TP),7SetListSubItem CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_SUBITEM, Cstr(i), Cstr(Comm),8SetListSubItem CSTR(frmID), CSTR("MyList"), LIST_VIEW_ACTION_ADD_SUBITEM, Cstr(i), Cstr(Interest),9nextEnd Sub
See Also