How to set position of suggestion list in AutoSuggestBox? - xaml

I have a UWP application with a number of AutoSuggestBox controls.
When the suggestion lists open, the drop-down is often positioned at the end of the list or at some random location in the middle. I'd like it to either open to the currently selected item, or open at the top of the list if nothing is selected.
I can't figure out how to control this.

How to set position of suggestion list in AutoSuggestBox?
The position was automatically controlled by the available display area, If the bottom area is not enough for dropdown rendering space, it will render top or middle. And it's by design. Currently, we have no such api that use to set the drop-down's placement, if you do want this feature please feel free post your requirement with Windows FeedBackHub app.

Related

Metro App Create Email Address Entry Xaml Control

How do I create a Control to input email addresses, similar to how capturing tags on stackoverflow works?
I am using C# and Xaml.
You will need:
TextBox(to show input area where you can type)
Popup(to show suggestions below TextBox like StackOveflow does)
ItemsControl(it goes into Popup, so you can just have collection of items and they will be displayed, note that ItemsPanel should be probably GridView)
Then you will need custom Button, that will be overlaid top of TextBox once tag has been added. You need to calculate how big is the button(width) and fill TextBox with empty spaces, to advance cursor further.
Also you need to control what keys are being pressed.
The effect you are after is probably that you recognize complete e-mail addresses, and render them in a custom way. I would do this by removing the completed addresses from the textbox, and wrap them in a skinned label (or maybe a custom control with a delete button).
The most straightforward way is to implement the textbox as a DockPanel with a border, suggesting that it is a text box. On the left side of your DockPanel, you have a StackPanel where you stack the completed address controls left-to-right. Then add a textbox with DockStyle=Fill to fill up the remainder of the DockPanel. Once you detect an email address is entered, you remove the characters from the textbox and add a matching control to the StackPanel.
There is probably a way to change the textbox contents without losing focus, otherwise you need to fix this though code.
Good luck!

How to edit Expression Blend selected control part?

I am trying to edit a specific control part within a custom TabItem Template. In this case, it's the TemplateBottomSelected control part.
I'm having an issue where I cannot seem to view or edit any control parts within the template editor except the default TemplateTopSelected. Here's a screenshot of what I'm talking about:
Even though I'm selecting the "TemplateBottomSelected" grid, the only thing I can see is the template for the TemplateTopSelected item.
How the heck do I edit the other control parts within the template using the editor?
Thanks!
that's because these templates are either collapsed or the opacity of them is set to 0. :)
you can use the eye toggle button to only show the one you want to modify at design time, set the visibility to visible, do your changes, and reset it to collapsed.
please let me know if you need more info.

Is it possible to add icon to each item of NSCombobox?

I am working on form application. I came across a scenario where i need to provide a ComboBox to user. Now in order to make look and feel more appealing, i want to display a small image or icon before each item of that combo box.
Is it possible to add icon to each item of NSCombobox?
Welcome any comment

Best way to select from a list - aren't the two listboxes getting a little old?

How many times have we seen this type of selector:
List Box Selector http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/MoveItemsListBox.jpg
I was just about to start creating this in a WinForms app, when I thought that others may have some ideas for doing this better. We need it to sort - so the right hand list will need up/down buttons. But this seems so old school. I love devexpress components, and was thinking of asking them if they would consider adding a component that handles this functionality with a slick UI.
I am thinking that a graphical representation of the objects, and a graphical representation of the listboxes - that would be a more intuitive way to move items around.
Has anyone seen an open source project like this?
If a CheckListBox won't suffice (and it usually will), then the "modern" approach would be to use a ListView or similar component with a "Transfer" column. Render the button inline in that column, one for each row, so that it only takes one click to move an item from one to the other.
You see this everywhere in Vista, usually with hyperlinks as opposed to buttons. Instead of clicking on an item and then choosing an action, you click the action at the item level.
I wouldn't go overboard with slickness as it can impair functionality, but the dual-listbox screen is definitely old-school.
Also, if there's a very large amount of data to manage, it helps to provide a progressive search at the bottom of one or both lists.
I have done this type of selection using (essentially) a single CheckListBox that displays each item as an image. Part of the image looks like a LED, which is on (bright) if the item is selected or off (dark) if it is not selected.
This works well if you have a reasonable amount of data to select from, and also works well in a multi-column format if you can predict that the options will have reasonably similar lengths.
Allow users to drag items in/out of list 2, and also drag to reorder in list2.
(All items dragged out of list2, and dropped anywhere outside the list, get put back into list 1, in their correct place in the list by alphabetical or natural order.)
You can merge the two list boxes into one with the help of groups (LVGF_GROUPID flag): one group for selected and one for not selected.
You can also implement group membership changes with drag-drop between them. This way single drag-drop can move an item into the other group at the appropriate position, saving most/all of the other buttons.
Additionaly the bottom of each group can have one pseudo item with help text (i.e. "Drag items here to...") that is visible only when relevant.

How to delete the Scrollbar in a class derived from wxHtmlListBox?

In widgets, I have a class named CListCtr which derived from wxHtmlListBox. The list contains 100 items, but I just want to show 10 items in one page and when I press button pagedown I will get another page to show another 10 items. I do not need the scrollbar. But it is always added when created the class.
How can I delete the scrollbar or not create it?
wxHtmlListBox is a specialized wxVScrolledWindow, which handles the scrollbar itself. Naturally, when there are more list items in the list than can be shown at the same time in the client area, a scrollbar will appear.
Note however that there's nothing to say that your wxHtmlListBox needs to contain all available items. If you give it enough space for 10 items, just call SetItemCount(10) instead of SetItemCount(100), and you will get no scrollbar. You can handle the page up / page down or any other navigation keys yourself, and invalidate the contents of your wxHtmlListBox. Since it is a virtual control you don't need to change any data, you just return the next or previous 10 items in your list in the OnGetItem() and OnGetItemMarkup() methods of your derived class.
Please note that this is just an idea how to implement this, I think it's not a good thing to do. The scrollbar is the indicator that there is more data and where the user is relative to begin and end of the data. Don't break the assumptions the user has. How is he to know that page up / down will scroll the visible data?