listbox

Delphi, List Index out of bounds

I have a TListBox on a form, and items are added with listbox1.ItemIndex := listbox1.Items.AddObject('msg', TObject(grp)); grp is an integer, The listbox is set to lbOwnerDrawFixed In the onDrawItem event i get the Exception EStringListError raise on the marked line msg := (control as Tlistbox).Items.Strings[index]; <-- this line ...

WPF: Hide ListBox groups when all contents are hidden

I am working on an application that has some ListBox's of information, it is possible that these could hold quite a lot of information (maybe up to 6 or 700 complex items - multiple text fields and images). I used the ListBox control in order to use the grouping, sorting and filtering functionality that you get with it, but it turns out...

Open a popup during mouseover of listbox textblock

Photosuru has a neat effect - when you mouseover the thumbnail image a popup opens showing the image enlarged. I am trying to get this to work on a listbox, similar to a tooltip, I need to mouseover an item and have the popup open. The problem, the popup only shows the item selected in the listbox. I tried looking through Photosuru code ...

Silverlight 3: Change ListBox items layout based on current ScrollViewer position.

Is it possible to update the layout of ListBox items (maybe using a custom ItemsPanel) based on the current position of a ScrollViewer? I'd like to provide some custom animations for the items to move around based on the ScrollViewer position. ...

losing focus from listboxitem in silverlight

So heres the situation, i have a listbox that has a itemcontainerstyle with a template that contains a usercontrol. Inside this usercontrol is: <Grid Name="Label" MouseLeftButtonDown="Label_MouseLeftButtonDown" > <TextBlock Name="Text" /> </Grid> </Border> <Grid Name="Editor" Visibility="Collapsed" > ...

How to change a ListBox's Vertical Scrollbar's Repeat Button Size in WPF

Hi there, I have a ListBox control with a vertical scrollbar. I would like to increase the Repeat Buttons' Height to something bigger because our UI is touch-compatible. Is there a simple way to do it ? Thank you and best regards, Romanin ...

Getting the index of multiple selected items in a listbox using Silverlight

Hello Stack Overflow, I have a ListBox which is made up of Grid Items in Multiple SelectionMode in Silverlight 3.0. When I use ListBox.SelectedIndex it only returns the first item which is selected. I would like to be able see all of the selected items such that it would return all of the selected item indexes' such as; 2, 5, and 7, e...

ListBox is selecting many items even in SelectionMode="Single"

I have encountered something very strange, simple WPF application <Window x:Class="ListBoxSelection.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <ListBox ItemsSou...

passing listbox item index as parameter to objectdataprovider

Hey guys, I am currently attempting to use an object data provider to return the colour that I would like to use as a background for each listbox item, with the colour dependent on that listbox items index. Basically the parameters passed to the object is the original colour and the listboxitem index, and it will return a colour that i...

How to highlight listbox's item on rightclick event?

Hello, I don't know if I'm the first to ask this question(I searched the whole board) but I never found any answers. As said in the title I am trying to highlight/select an item in my Listbox whenever I right click it. Here is the XAML code: <ListBox Grid.Row="1" x:Name="ContactList" Margin="6" ItemsSource="{Binding ''}"> <ListBox...

Setting listbox selecteditem in dataform in silverlight not working

I've got a child window that I popup to create events. I'm using the DataForm control and one of the fields is a selection from a listbox of event types. I can see that when the window closes, the event type is set properly on the event. If I pop the window back up and set the event to the one just created, all the fields populate fin...

WPF - Image control inside Listbox

Hi, I am displaying images inside the list box. Binding the source of the image control using object through datacontext of the listbox. Problem: I want to display No image (Image) if the url does't have image. Is it possible do it in the xaml code. Code: <ListBox ClipToBounds="False" x:Name="lbBestSellerImage" Width="Auto" Ite...

WPF - keyboard behavior in Grouped ListBox vs. Grouped ComboBox

I Want My ComboBox to Behave like The standard ListBox When my data is grouped ListCollectionView and an Expander. I've Noticed that when I use the ListBox I can Move between the item groups and open\close the expandrs, but when I try to switch the ListBox to ComboBox, I get 'trapped' in the group i'm in - While using only the keyboard....

Silverlight 3 ListBox - Provide an animation to control scrolling

By default, the SL3 listbox scrolls items either one item at a time or a few pixels at a time depending on whether virtualization is used. Is it possible to manually control the scroll behavior, maybe say that the ListBox should scroll from 1 item to the next over a period of 2 seconds with a certain easing function? ...

Applying a style to ItemContainerStyle in C#

When I'm applying a Style to a ListBox.ItemContainerStyle in C# it isn't making the change at runtime. I'm using; myListBox.ItemContainerStyle = (Style)(App.Current.Resources["NewItemStyle"]); However all other styles are being supplied, such as Buttons etc where I'm going myButton.Style = (Style)(App.Current.Resources["myMainButtonS...

How to make a ListBox longer than the page?

I have a list of 100 or so items. I'd like to output all the items to the page, one beneath the other. Maybe 25 or so items will be visible initially, and when the users scrolls, the rest of the list will be visible. The catch here is that I don't want to use the ListBox's scrollbar - I want to use the page's scrollbar. (By page, I m...

Add multiple items to a listbox on the same line

Hey guys, i figured out how to add items to a listbox one line at a time: try { if (nameTxtbox.Text == "") throw new Exception(); listBox1.Items.Add(nameTxtbox.Text); nameTxtbox.Text = ""; textBox1.Text = ""; nameTxtbox.Focus(); } ...

Problem with updating ListBox control in WPF

I have an application which has to monitor 211 rods, and every 5 seconds it will update 2 ListBox controls, each one containing either the inserted rods or the removed ones. When I manually use the button for inserting/removing rods the code executes perfectly and the ListBoxes update properly. When I use the global button which inserts ...

How can I move a listbox around an Access form using VBA?

I'm really brand new to all this, so excuse me if it's a stupid question. I've got two list boxes on an MS Access form. I'm resizing the list boxes based on how much data I'm getting back. However, this form needs to print, and the list boxes have enough data in them that they need to stack one above the other. When the first list box ex...

Combining list boxes into rich text boxes?

Hey all, another homework assignment here thats kind of unclear on the requirements. It is a forms program that assigns people to seats on an airplane. The part that is losing me is that its telling me to display the passenger manifest in a list box, but then its telling me to display it in a list box. Then it calls it a rich text box a...