206 views
in GUI Development by
Hi,

I implemented a vertical list to list a number of items as a list.

I want to select multiple items at a time, also need to set a border of 2px width to highlight the selected item.

I currently used border to highlight the item.

 

When i selected the adjacent items in a list the border is also become visible and the border width 4 px ( but i need 2 px as width).

could you please help me out to solve this issue?

1 Answer

0 votes
by

Hello Melvin,

from your question I'm not sure whether you have already implemented the multiple selection or not. If this is not the case let me first refer to your question from November 2021: how to select multiple items in a vertical list. It also contains an example for multiple selection.

Concerning the border width, what you want is the edge between adjacent selected items to appear thiner. From technical point of view, the adjacent items have no information about the selection status of their neighbours. You will need to enhance the items by additional properties to configure the top and the bottom border edges individually. When loading the items in the OnLoadItem event you can set the properties according to the selection status of the above/below neighbour of the actually loaded item. This is similar to the Selected property explained in the above referenced threads.

The second step is to modify the implementation of your item. Actually you use the Border view. With this view you can configure the border width for all four edges at once. Changing the width individually for the top/bottom edges is not possible. What can you do? Remove the Border view and replace it by four Filled Rectangle views - one for each edge. Now, depending on the selection status of the item and the selection status of its adjacent items, you adjust the height of the rectangles at the top and bottom edges.

Does it help you further?

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...