Hi Michael,
The RibbonComboBoxItem don't have a GetItemByIndex (long index ) function.
You can use theTotalitions, SelectItem and Selectedindex function to work it around.
Please refer to the local PB Help documentation for details.
Here is a sample example:
RibbonComboBoxItem lr_combobox
ribbonmenu lr_menu
string ls_tag, ls_piclist
integer li_rtn
long ll_count, ll_i
ls_tag = "Page size"
li_rtn = rbb_2.getitembytag( ls_tag, lr_combobox)
if li_rtn = 1 then
if lr_combobox.allowedit = true then
lr_combobox.allowedit = false
lr_combobox.label ="Mark Test:"
lr_combobox.text = ""
lr_combobox.sorted = false
lr_combobox.vscrollbar =true
lr_combobox.hscrollbar =true
ls_piclist = lr_combobox.getboxpicturelist( )
ll_count = lr_combobox.totalitems( )
ll_count = lr_combobox.insertitem( "Large A2",ll_count+1, ll_count+1)
ll_count = lr_combobox.insertitem( "Large A0",ll_count+1, ll_count+1)
ll_count = lr_combobox.insertitem( "Large A1",ll_count+1, ll_count+1)
ll_count = lr_combobox.insertitem( "Large A3",ll_count+1, ll_count+1)
ll_count = lr_combobox.insertitem( "Large A4",ll_count+1, ll_count+1)
ls_piclist =ls_piclist+ ",PaperSizeA0Small!,PaperSizeA1Small!,PaperSizeA2Small!,PaperSizeA3Small!,PaperSizeA4Small!"
li_rtn = lr_combobox.setboxpicturelist( ls_piclist )
lr_combobox.boxheight = 900
lr_combobox.boxwidth = 600
lr_combobox.width = 1000
else
lr_combobox.allowedit = true
lr_combobox.label =""
lr_combobox.text = "Test"
lr_combobox.sorted = true
lr_combobox.vscrollbar =false
lr_combobox.hscrollbar =false
ll_count = lr_combobox.totalitems( )
If ll_count > 5 then
for ll_i = ll_count to 6 step -1
lr_combobox.deleteitem( ll_i)
next
ls_piclist = "PaperSizeA0Small!,PaperSizeA1Small!,PaperSizeA2Small!,PaperSizeA3Small!,PaperSizeA4Small!"
li_rtn = lr_combobox.setboxpicturelist( ls_piclist )
end if
lr_combobox.boxheight = 600
lr_combobox.boxwidth = 300
lr_combobox.width = 400
end if
rbb_2.setcombobox( lr_combobox.itemhandle , lr_combobox)
end if
Regards,
(A) As you suggest: 1) GetBoxPictureList for pictures in CSV text. 2) Convert to array. 3) Loop to select each index; 4) Inspect ComboBox.Text = selected item's Text; 5) At end restore original selection.
(B) Alternative: 1) Export to JSON/XML; 2) Parse to find the ComboBox; 3) From ComboBox loop through all its items.