listbox

How to make a More button on the end of a listbox and handle it?

故事扮演 提交于 2019-12-24 03:19:15
问题 I added this resource on App.xaml <Style x:Key="ListBoxMore" TargetType="ListBox"> <Setter Property="Background" Value="Transparent"/> <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> <Setter Property="BorderThickness" Value="0"/> <Setter Property="BorderBrush" Value="Transparent"/> <Setter Property="Padding"

Inserting a button into a tkinter listbox on python?

≯℡__Kan透↙ 提交于 2019-12-24 02:57:10
问题 ... self.myListbox=tkinter.Listbox() self.myListbox.pack() self.myButton=tkinter.Button(self.myListbox,text="Press") self.myListbox.insert(1,myButton.pack()) ... I want to insert a button into listbox like inserting a sting. How can I do this? 回答1: You can't. From the listbox documentation: "A listbox is a widget that displays a list of strings". You can, of course, use pack, place or grid to put a button inside the widget but it won't be part of the listbox data -- it won't scroll for

Sliding effect when adding new items to a WPF ListBox

别等时光非礼了梦想. 提交于 2019-12-24 02:45:23
问题 I have a WPF ListBox control which displays items of an RSS feed. I occasionally check the source of the RSS feed for new items. Once I detect a new item I add it to the observable collection which immediately adds the new item to the ListBox display. Is there a way to 'slide in' the new item from the top, pushing down the existing items? How would I achieve such an effect? Can it be done with a ListBox, or do I need to resort to my own container, such as a StackPanel and animate for example

WPF ListBox scrollbar is not working

旧街凉风 提交于 2019-12-24 02:24:32
问题 <ListBox Name="myListBx" ItemsSource="{Binding Collection}" Margin="5,5" SelectedValuePath="ColId" SelectedValue="{Binding Path=ColId}" SelectionMode="Multiple" BorderThickness="0" Background="{x:Null}" BorderBrush="{x:Null}" ScrollViewer.VerticalScrollBarVisibility ="Auto"> <ListBox.ItemTemplate> <DataTemplate> // blabla </DataTemplate> </ListBox.ItemTemplate> </ListBox> My ListBox contains so many elements and actually the scrollbar should work but it's not even visible. Am I doing

tkinter.Listbox scrolbar yview

五迷三道 提交于 2019-12-24 01:59:16
问题 I again encounter some problems in writing Python and would like to seek my help. I continue to build my Listbox widget but cannot setup a scrollbar. I can put the Scrollbar in the right position, however, the up and down just don't work out and pop up an error saying "Object() takes no parameter". Could anyone advise how to fix it? I attached the code below for reference. import tkinter from tkinter import * def test(): root = tkinter.Tk() lst = ['1', '2', ' 3', '4', '5', ' 6', '7', '8', ' 9

WP7 ListBox selected item is not changing the color

故事扮演 提交于 2019-12-24 01:19:48
问题 I have a ListBox in app, it has an image and textbox inside. I want to set 2 colors and 3rd one for selected item. <ListBox.ItemTemplate> <DataTemplate x:Name="Template1"> <StackPanel Orientation="Horizontal" > <Image Width="100" Height="100" Source="{Binding SmallImage}"></Image> <Grid> <TextBlock Text="{Binding Caption}" Foreground="{Binding txtColor}"></TextBlock> </Grid> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> when I'm changing the foreground color, then the selected item

ListBox presenting only one item

烈酒焚心 提交于 2019-12-24 01:14:58
问题 I have a ListBox and a class with strings. Each time that a user clicks add button in the application, I create a new instance of the class and add it to the list which is binded to the ListBox . The first time I click the add button, the list box shows the first item, but the next time it doesn't show two items. XAML - this is the ListBox : <ListBox Name="ListBox_BinsRegion" Height="181" Margin="233,16,6,94" Width="253" Background="Transparent" BorderThickness="1" BorderBrush="Black"

how to display the content of a structure in a listbox in a c# windows form application

跟風遠走 提交于 2019-12-24 01:14:25
问题 Dunno if I'm going the right way about this? The contents of the structure below is defined elsewhere. when I run the code it is just outputting a list of 4 zeros. any help would be greatly appreciated..... public class NativeMethods { public struct FT_DEVICE_LIST_INFO_NODE { public uint ID; public uint LocId; public string SerialNumber; public string Description; } [DllImportAttribute(@"C:\Users\Brendan\Documents\libMPSSE.dll", EntryPoint = "SPI_GetNumChannels")] public static extern uint

Create ItemTemplate for ListBox in code-behind in WPF - Part II

╄→尐↘猪︶ㄣ 提交于 2019-12-23 22:34:38
问题 I named this question of mine Part II since I've already asked a similar but simpler question about creating an ItemTemplat for ListBox in WPF in here Create ItemTemplate for ListBox in code-beind in WPF Now I'm going to expand my question. I want to have an ItemTemplate for a ListBox so that it can be used either with or without binding to an ObservableCollection. If I don't want to bind the ItemsSource to an ObservableCollection I use the code as follows: var textBlockFactory = new

How to programatically select an item in a data bound ListBox control

只愿长相守 提交于 2019-12-23 22:22:05
问题 I have a custom styled ListBox: <phone:PhoneApplicationPage.Resources> <Style x:Key="LayoutsListItemStyle" TargetType="ListBoxItem"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ListBoxItem"> <Grid Height="170" Width="170" Margin="0,0,20,20"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="LayoutStates"> <VisualState x:Name="BeforeUnloaded"/> <VisualState x:Name="BeforeLoaded"/> <VisualState x:Name="AfterLoaded"/> </VisualStateGroup>