listbox

Binding a Dictionary's key and value in a listbox with wpf

杀马特。学长 韩版系。学妹 提交于 2019-12-17 18:53:12
问题 I am trying to bind a dictionary's key to a row of the grid in a listbox, and bind the dictionary's value to another row of the grid. key's type is Book, a class thati wrote and the value's type is int. i want to write the elements of the class and the integer value in grid. Can you help me on this? I'm quite confused on determining the itemsSource and the data type to bind. thanks for helping Edit: i forgot to say that i am using c# - wpf. =) I sent the dictionary as the itemsSource, and i

Scrolling multiple Tkinter listboxes together

╄→гoц情女王★ 提交于 2019-12-17 18:44:41
问题 I have multiple Tkinter listboxes that I have scrolling together using a single scrollbar, but I'd ALSO like them to scroll together for mousewheel activity over any of the listboxes. How to do this? My current code is based on the last pattern discussed here: http://effbot.org/tkinterbook/listbox.htm It works fine when using only the scrollbar, but the listboxes scroll independently when the mousewheel is used. 回答1: Solve the problem pretty much the same way as you did to connect the two

Windows Phone 7: Highlight Selected Listbox item

与世无争的帅哥 提交于 2019-12-17 16:27:41
问题 I have the following XAML (simple list box with custom DataTemplate). I'm trying to figure out how to highlight the selected item (maybe background colour change). I figure I need to do something with Styles in Expression Blend but I'm not quite sure where to start... Edit: After a bit of playing around I now have this (which doesn't seem to do anything) <phone:PhoneApplicationPage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx

Silverlight 3: ListBox DataTemplate HorizontalAlignment

試著忘記壹切 提交于 2019-12-17 15:47:22
问题 I have a ListBox with it's ItemTemplate bound to a DataTemplate. My problem is I cannot get the elements in the template to stretch to the full width of the ListBox. <ListBox x:Name="listPeople" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0,0,0,0" Background="{x:Null}" SelectionMode="Extended" Grid.Row="1" ItemTemplate="{StaticResource PersonViewModel.BrowserDataTemplate}" ItemsSource="{Binding Mode=OneWay, Path=SearchResults}" > </ListBox> <DataTemplate x:Key=

WPF ListBox Image Selected the saga continues

こ雲淡風輕ζ 提交于 2019-12-17 15:42:41
问题 Ok in my ListBox scrolling images w/ text, etc. the saga continues. When I click one of the items, to select it, that runs a process to open a web browser and go to a specific URL. The problem I'm having now is that when the WPF app loses focus, and the web browser opens, the item clicked inside the listbox turns white. Here's the whole ListBox XAML. I have set the selected items to transparent, so does this have something to do with the WPF app losing focus? Is there something I can add tom

WPF ListBox Image Selected the saga continues

微笑、不失礼 提交于 2019-12-17 15:42:09
问题 Ok in my ListBox scrolling images w/ text, etc. the saga continues. When I click one of the items, to select it, that runs a process to open a web browser and go to a specific URL. The problem I'm having now is that when the WPF app loses focus, and the web browser opens, the item clicked inside the listbox turns white. Here's the whole ListBox XAML. I have set the selected items to transparent, so does this have something to do with the WPF app losing focus? Is there something I can add tom

WPF - Animate ListBox.ScrollViewer.HorizontalOffset?

若如初见. 提交于 2019-12-17 15:41:35
问题 I have a collection of Visual s in a ListBox . I need to find the XPosition of an element inside it and then animate the HorizontalOffset of the ListBox 's ScrollViewer . Essentially I want to created an animated ScrollIntoView method. This gives me a couple of problems. Firstly, how can I get a reference to the ListBox s scrollviewer? Secondly, how can i get the relative XPosition or HozintalOfffset of an arbitrary element in the ListBox ? I'm not reponding to any input on the ListBox itself

Moving items in Dual Listboxes

旧时模样 提交于 2019-12-17 15:41:14
问题 How can I move items from one list box control to another listbox control using JavaScript in ASP.NET? 回答1: This code assumes that you have an anchor or that will trigger to movement when it is clicked: document.getElementById('moveTrigger').onclick = function() { var listTwo = document.getElementById('secondList'); var options = document.getElementById('firstList').getElementsByTagName('option'); while(options.length != 0) { listTwo.appendChild(options[0]); } } 回答2: If you're happy to use

Double Click a ListBox item to open a browser

纵然是瞬间 提交于 2019-12-17 15:39:30
问题 I have a ListBox in my wpf window that binds to an ObervableCollection . I want to open the browser if someone clicks on an element of the ListBox (just like a link). Can someone tell me how to do this? I found something with listboxviews, does it only work this way or is there a way by just using the ListBox ? Yours Sebastian 回答1: You can add a style to ListBox.ItemContainerStyle, and add an EventSetter there: <ListBox> .... <ListBox.ItemContainerStyle> <Style TargetType="{x:Type ListBoxItem

How can I set different Tooltip text for each item in a listbox?

大城市里の小女人 提交于 2019-12-17 09:31:10
问题 I have a listbox that is databound to a Collection of objects. The listbox is configured to display an identifier property of each object. I would like to show a tooltip with information specific to the item within the listbox that is being hovered over rather than one tooltip for the listbox as a whole. I am working within WinForms and thanks to some helpful blog posts put together a pretty nice solution, which I wanted to share. I'd be interested in seeing if there's any other elegant