How to Possible to select last item of listbox by tap on when last item stay under the application bar? - windows

Listbox contain several items. when i scroll to last item and take initiate to select the item by taping on is not possible cause of that item presence under application bar. Now anybody can say what should i do??? Sample code bellow:

Okay, so no sample code huh? :). But judging by the scenario, I think you've not limited the height of your listbox. Set the height so that the listbox's area is limited above the applicationbar.

As PhoBi mentioned, adding code to your post would be more helpful. however, try this code to limit the size of the listbox:
MyListBox.Height = Application.Current.Host.Content.ActualHeight;
you may need to account for other controls' space. for e.g.:
MyListBox.Height = Application.Current.Host.Content.ActualHeight - (HeaderStackPanel.ActualHeight);

Related

How to make items in a FMX TListBox bold?

How can I make the items in my FMX TListBox bold? I can't find anything by myself, either in the documentation or the Internet.
You need to set two properties for the tListItem in question. The first line of code below lets you set the font properties for that ListItem rather than having the style dictate the font properties (if you miss this step, the next step will have no affect). The second line sets that ListItem to bold (where, of course, x is the index within the list that should be made bold)
ListBox1.ListItems[x].StyledSettings:=[];
ListBox1.ListItems[x].Font.Style:=[TFontStyle.fsBold];
Thanks to Gregg who gave a working answer for delphi, i'll put a C++Builder version here.
I made a loop over my ListBox with the item count, and it does not affect the loading speed of the ListBox (around 4000 items in my case) so it's a good solution at least for me.
ListBox->ListItems[x]->StyledSettings = ListBox->ListItems[x]->StyledSettings >> TStyledSetting::Style;
ListBox->ListItems[x]->Font->Style = ListBox->ListItems[x]->Font->Style << fsBold;
You can use custom theme for TListBoxItems. Create one by right mouse on ListBox.

Why won't my windows form Data repeater Resize?

After searching for a few days, i thought maby someone can help me.
I'm making a Windows form Application. And on one of my views i have a repeater with a label in there. This label is dynamicly sized. But My DataRepeater item won't adjust to the size of my label.
Has anyone a idea how to fix this?
The datarepeater i use is from the visual basic powerpacks.
If any more Infromation is needed to help me, please let me know.
Regards Stephan
It looks like DataRepeater is very limited with regards to resizing. I found this website that it looks like they got it working, but all of the items resize to the same size.
http://social.msdn.microsoft.com/forums/en-US/vbpowerpacks/thread/c93579f2-8b4c-4002-9ce2-152e2dddd10e/
Edit:
This solution is a little bit more complex, but VERY flexible:
You can use a FlowLayoutPanel:
You create an User Control for the item on the list and add a Select Property to the User Control.
You add a list of the User Controls to the FlowLayoutPanel.
When the User Control change size, it automatically adjust everything in the FlowLayoutPanel. (Disable WrapContents to prevent Horizontal Scrolling)
http://msdn.microsoft.com/en-us/library/ms171633.aspx
You can use the following in the UserControl to enable Click on the User Control to select it:
Click event for .Net (Windows Forms) user control
In the form that use the FlowLayoutPanel, you add the Click event, and then apply the Select to only that one User Control.
You can use the SetBoundsControl inside the User Control to set the size of the item.

ListPicker - how to make current selection show when full page view opens

I'm using the ListPicker from the latest Silverlight Toolkit on Mango
I've got a long list (100 items) of simple text items to choose between - using single item selection mode.
When I click on the ListPicker it opens up in full screen very nicely, but it doesn't scroll to the current selection.
This is a pain for the user - who typically wants to move from "item75" to "item76"
I've looked through the available properties, events and source code, but I can't see any obvious way to get the list to scroll the current selected item into list when the full screen mode opens.
Anyone got any ideas?
I found this Which may help, i hope it does!
in Depth ListPicker
See on MSDN what some of the events that can be triggered when selecting a Listpicker item and mess around with them, you may find a Very good Solution! :)
There didn't seem to be a way to do this with the current release - but the code is open source.
The current release also has a disadvantage of using StackPanel instead of VirtualizingStackPanel - so it is very slow at displaying long lists.
Instead of using this release, I ended up going with a different list selector http://priyarules.posterous.com/categorized-list-selector-for-windows-phone-7

Windows Menu: MF_HILITE flag does not cleared

I have CMenu instance on which I add multiple items. For one of the items I added in it, I set the MF_HILITE flag.
When I show the menu, the appropriate item get hi-lighted correctly, as requested. The problem is that it stays hi-lighted until I move the mouse over it and leave. I only want one item to be hi-lighted at the time. It seems that Windows does not un-light it when another item is hi-lighed.
How could I force it to be un-lighted as soon as another item get the hi-light? I could not find any mouse-over callback or message for the menu, and I could not find a invalidate either.
You're using MF_HILITE in a weird way. The item isn't actually highlighted, it's just drawn like it is. If the user presss enter, the "highlighted" item won't be selected.
You're probably looking for MF_DEFAULT.
It does not appear to be possible.
The internal state for the currently selected item in the menu can't be set. Using the MF_HILITE or HiliteMenuItem does not set the currently selected item, it only sets the visual style.
As a work-around, I have used a popup ListBox instead, which has all the features I need.

How force NSMenuItem to redraw?

I'm implementing a custom status bar menu, which has a custom view with NSSearchField. I'm updating number of menu items according to search results. The number of menu items is changed as user types in the NSSearchField. I've noticed, that if number of results stays the same, items titles are not updated (redrawn). How do I force them to redraw?
In the function, that rebuilds the menu I remove first all items and then create new items according to the search results.
Thanks,
Nava
I could achieve it by following approach: When the number of search results is the same, i don't recreate them, just change the title and call itemChanged:. When the count is different I recreate menu items. This works anyway. But I was advised anyway to get back from using menu for this purposes.
on the menu set menuChangedMessagesEnabled to YES when you want to update the menu:
[menu setMenuChangedMessagesEnabled:NO];
// change the menu
[menu setMenuChangedMessagesEnabled:YES];
The second invocation causes the menu to apply changes. The first one is so that you can batch a group of changes together.
That said, Apple guidelines discourages changing menus while they're open as users are not used to this and can be confusing. If it's feasible try to redesign your app so you can use something else, say a table or matrix, instead of a menu.

Resources