| View previous topic :: View next topic |
| Author |
Message |
Womble General User

Joined: 27 Jan 2011 Posts: 14 Location: UNITED KINGDOM
|
Posted: Tue Mar 15, 2011 12:38 pm Post subject: Combo Box list index |
|
|
Hi All,
Try as I might I have been unable to find the combo box property that contains the index number of the selected Item. I have searched the forums etc. and tried x-ray but nothing seems to show up there.
The Combo Box is populated from a series of cells in Calc. and I need to know from which cell the selected item originated and the index of the selection would give me this. The contents of the cells may change so I can't use the "ComboBox1.Value" or ".Text " Properties.
The following Code
| Code: | Dim Doc as Object, Form as Object, mySelection as Integer
Doc = ThisComponent
Form = Doc.getDrawPages.getByIndex(0).getForms.getByIndex(0)
mySelection = Form.getByName("ComboBox1").getSelectedItemPos |
does not work. Can anyone help please.
Dave. |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Wed Mar 16, 2011 3:37 am Post subject: |
|
|
A combo box is not the same as in MS Access. In OOo it is nothing more than an enhanced text box with suggestions offered by means of auto-complete. The list provides an additional way to make suggestions. You can type anything into the control. It is not limited to the suggestions. Using combos in Calc makes not sense. Instead you can use validations or auto-complete more efficiently. _________________ Rest in peace, oooforum.org
Get help on http://forum.openoffice.org |
|
| Back to top |
|
 |
Womble General User

Joined: 27 Jan 2011 Posts: 14 Location: UNITED KINGDOM
|
Posted: Wed Mar 16, 2011 10:48 am Post subject: |
|
|
Thank you. I will have to find an alternative solution.
Dave. |
|
| Back to top |
|
 |
|