Question
Can a control be set to a value (similar to the set_tile function)?
Answer
Each control that stores or displays a value can be set by it's appropriate property at run time.
The TextBox uses the "Text" property to draw it's value from.
; get the text property
(setq text (Odcl_Control_GetProperty TestProject_DclForm1_TextBox1 "Text"))
; set the text property
(Odcl_Control_SetProperty TestProject_DclForm1_TextBox1 "Text" "New text goes here") The ScrollBar, SliderBar and SpinButton use the "Value" property to draw their current values from.
; get the value property
(setq text (Odcl_Control_GetProperty TestProject_DclForm1_ScrollBar "Value"))
; set the value property
(Odcl_Control_SetProperty TestProject_DclForm1_ScrollBar "Value" 100) The "Caption" property is used by the Label, TextButton, GraphicButton, OptionButton, CheckBox and UrlLink to display text to the user.
; get the text caption property
(setq text (Odcl_Control_GetProperty TestProject_DclForm1_Label1 "Caption"))
; set the text caption property
(Odcl_Control_SetProperty TestProject_DclForm1_TextBox1_Label1 "New text goes here") The Listbox, ListView and ComboBox do not user properties to get and set their lists and currently selection.
Odcl_ComboBox_AddString, Odcl_ComboBox_AddList, Odcl_ListBox_AddString, Odcl_ListBox_AddList, Odcl_ListView_FillList, Odcl_ListView_AddItem, Odcl_ListView_InsertItem, and Odcl_ListView_AddColumn are used to add list items to these controls.
Odcl_ComboBox_GetSelectedItems, Odcl_ListBox_GetSelectedItems and Odcl_ListView_GetSelectedItems are the best methods to get the current selection set from these controls.
Knowledge Base
FAQ