Hi again,

sorry for taking so long to answer. I now solved the Problem.

> I am currently implementing a little dialog with an
> UnoControlListBoxModel. Now I want to preselect an entry of the list.
> How can I do this? I tried the SelectedItems option, but it did not work.

> How can I preselect an item?

Here is the code:
-----%<-----
Object listModel02 =
        xMSF.createInstance("com.sun.star.awt.UnoControlListBoxModel");
XPropertySet xPSetListBox02 = (XPropertySet) UnoRuntime.queryInterface(
        XPropertySet.class, listModel02);
xPSetListBox02.setPropertyValue("PositionX", new Integer(60));
xPSetListBox02.setPropertyValue("PositionY", new Integer(5));
xPSetListBox02.setPropertyValue("Width", new Integer(60));
xPSetListBox02.setPropertyValue("Height", new Integer(14));
xPSetListBox02.setPropertyValue("Dropdown", true);
xPSetListBox02.setPropertyValue("Name", LIST_TRAYS);
if(printerlist.length > 0) {
        xPSetListBox02.setPropertyValue("StringItemList",
                Printer.getPrinterTrays(printerlist[0]));
        short[] myShort = {(short)0};
        xPSetListBox02.setPropertyValue("SelectedItems", myShort);
}
-----%<-----

Thanks for your help!

Greetings, Tobias

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to