listbox

What are the possibilities of displaying items in a listbox?

让人想犯罪 __ 提交于 2019-12-10 15:22:58
问题 I've been trying to figure out for a long time now how to create an interface that can allows users to input several rows of data and pass those entries into an SQL server database all in one shot. I could not get any better ideas so I came up with this (see picture below). What I envisioned is that the user enters values in the textboxes and hits the "add to list" button. The values are then populated in the list box below with the heading "exhibits lists" and when the add exhibit button is

Creating a ListBox of images?

蹲街弑〆低调 提交于 2019-12-10 15:20:12
问题 How can I create a ListBox control on my Winforms application that has images in an orderly fashion, just like it holds text? I'd like the images to appear like this: Maybe I don't even need to use a ListBox. Maybe there's a better control out there for this purpose? Thanks! 回答1: You possibly want an owner-draw list box. There's an example on the MSDN page for the DrawItem event. 回答2: Load all your images into an imagelist, using a unique key for each image, such as a filename. Make sure you

removing multiple selected items in a listbox - code only recognising first selection

*爱你&永不变心* 提交于 2019-12-10 14:54:49
问题 I have two listboxes and am trying to add items from List 1 to List 2, and then be able to remove multiple items from List 2 at once. Note that List 1 stays stagnant (this is how it is supposed to be). I have the adding items working right: 'Add the selected items to List 2 Dim i As Integer If lst1.ItemsSelected.Count > 0 Then i = 0 While i < lst1.ListCount If lst1.Selected(i) Then lst2.AddItem (lst1.ItemData(i) & ";" & lst1.Column(1, i) & ";") lst1.Selected(i) = False End If i = i + 1 Wend

VBA (Excel) ActiveX ListBox Change Event recursive behaviour

最后都变了- 提交于 2019-12-10 13:59:08
问题 I'm not a VBA programmer so I apologize in advance if some of my terminology in this question is incorrect. A colleague of mine wanted to clear the selection from a list box as soon as it was selected. After some googling we found one way to do it was via the Change event. Initially we tried: Private Sub ListBox1_Change() For i = 0 To ListBox1.ListCount - 1 ListBox1.Selected(i) = False Next i End Sub However, it seemed that setting the Selected property to False triggers a Change event on the

How to add different background colors to alternate rows to list box items windows phone 8

徘徊边缘 提交于 2019-12-10 13:48:27
问题 I'm new to windows phone development. I'm showing data in list box. For for all rows in the list box the back ground color is same. But I want to add two different colors for alternate rows to list box items. Below is the code for list view. <Grid x:Name="ContentPanel" Grid.Row="1" Margin="0,10,0,0" Background="White"> <ListBox Margin="6,6,-6,6" Name="itemslb" SelectionChanged="itemList_SelectionChanged"> <ListBox.ItemTemplate> <DataTemplate> <Grid x:Name="listItem"> <Grid.RowDefinitions>

Disabling Listbox is not changing background color in style

一个人想着一个人 提交于 2019-12-10 13:44:30
问题 I have this simple style that does not change the ListBox Background when the ListBox is disabled: <Style TargetType="ListBox" > <Style.Triggers> <Trigger Property="IsEnabled" Value="True"> <Setter Property="Background" Value="Red"/> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Background" Value="Orange"/> </Trigger> </Style.Triggers> </Style> Snoop does not help me on this one and I cannot figure a simple way without overriding templates. Anyone have a simple way

ListBox doesn't show changes to DataSource

荒凉一梦 提交于 2019-12-10 13:29:00
问题 I thought this was a simple problem, but I can't find any information on the web. I'm binding a ListBox to a List using BindingSource like so: List<Customer> customers = MyMethodReturningList(); BindingSource customersBindingSource = new BindingSource(); customersBindingSource.DataSource = customers; customersListBox.DataSource = customersBindingSource; Now, when I add or delete from customers list, my ListBox gets updated (even without using ResetBindings on BindingSource ), but if I change

Transparent WPF ListBox with selectable items

无人久伴 提交于 2019-12-10 13:28:10
问题 Could anyone suggest how I can implement a WPF ListBox that (effectively) has a transparent/hit-test-invisible background, but whose items are still hit-test-visible? In other words, I'd like to be able to click - through the ListBox's background - to controls underneath it, but still be able to select the ListBox's items. I have ListBox using a custom layout panel (it's a ListBox because the items need to be selectable). However, I need this panel to be overlayed on top of other controls,

WPF: System.ArgumentException => {“'{0}' is not a Visual or Visual3D.”}

本秂侑毒 提交于 2019-12-10 13:16:26
问题 when I d ouble-click - or click once when its already focused - below the items in a empty area of the Listbox which is within my DataGridTemplateColumn then I get the above error message. WHAT do I wrong? This is my Code: <DataGridTemplateColumn Width="0.3*" Header="Attachments"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <StackPanel Orientation="Vertical"> <Button>Add</Button> <Button>Delete</Button> <ListBox Name="itemListBox" BorderThickness="0" ItemsSource="{Binding Attachments

How can I put a separator between every ListBoxItem in my ListBox?

爷,独闯天下 提交于 2019-12-10 12:49:49
问题 Here's my XAML: <ListBox Grid.Row="1" x:Name="lstGames" Background="#343434" > <ListBox.ItemTemplate> <DataTemplate> <Grid ShowGridLines="True"> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> <Image Grid.Column="0" Source="{Binding ImageUrl}" Width="100"/> <StackPanel Grid.Column="1"> <StackPanel Orientation="Horizontal"> <TextBlock Text="Title:" /> <TextBlock Text="{Binding Title}" /> </StackPanel> <StackPanel Orientation="Horizontal"> <TextBlock