listbox

How can I make a in interactive list in Python's Tkinter complete with buttons that can edit those listings?

荒凉一梦 提交于 2019-12-08 03:22:24
问题 Basically I want there to be a list, which displays files I have stored in a certain folder, and beside the list there are buttons which open up separate windows which can edit or add a new item to that list. I want addchar to open up an new window with spaces for different fields, then when you press a "create" button in that window it closes, creates a file on the info you just entered (that's why i've imported os) as well as creating a new item on the main interface's listbox as the name

C#'s ListBox doesn't see my overrided Sort() method

烈酒焚心 提交于 2019-12-08 03:20:29
I'm trying to override Sort() method in my custom control. When my control contains ListBox and then I override Sort() method, everything works. But when I want my ListBox (1) to be extended by another ListBox (2) , that contains Sort() method, and then add that ListBox (1) to my UserControl, then it sorts too, but isn't using my Sort() method (seems like it doesn't see my Sort(), just normal Sort() from ListBox class). My ListBox (2) contains code: //... public class MyListBox: ListBox { public MyListBox { this.Sorted = true; } // more methods override protected void Sort() { // sorting code

Binding items into ListBox multiple columns

笑着哭i 提交于 2019-12-08 03:16:52
问题 I am trying to add my data into multiple columns ListBox, I did it but I am facing a hard problem when trying to retrieve the Data from the list box. is there a way to put an object instead of text into a listBox row? <ListView Name="listBox1" ItemsSource="{Binding Items}" Margin="28,28,68,67" FlowDirection="RightToLeft" MouseDoubleClick="listBox1_MouseDoubleClick"> <ListView Name="listBox1" ItemsSource="{Binding Items}" Margin="28,28,68,67" FlowDirection="RightToLeft" MouseDoubleClick=

WPF ListBox Virtualization and Mulltiple types in the ItemsControl

☆樱花仙子☆ 提交于 2019-12-08 02:58:14
问题 I've got a ListBox that is used to show items of multiple types (all derived from the same base type) that are bound to the ItemsSource through an ObservableCollection<T> . The performance of said ListBox is terrible. It appears that virtualization is disabled. According to: http://msdn.microsoft.com/en-us/library/cc716879(v=vs.110).aspx it seems that adding items of multiple types to the ItemsControl may be the problem. Here's my ListBox's style: <Style x:Key="{x:Type ListBox}" TargetType="

DataTextField in a ListBox is a combination of 2 fields

允我心安 提交于 2019-12-08 02:55:51
问题 I have a listbox containing Users. The datasource is an generic list of the type User (contains, id, firstname, lastname, ...). Now I want to use the id as datavalue (through dataValueField) and I want LastName + ' ' + Firstname as a DataTextField. Can anyone tell me how this is possible? I'm using C# (ASP.NET). 回答1: The easiest way is to add a new property to the User class that contains the full name: public string FullName { get { return LastName + " " + FirstName; } } And bind the listbox

Wpf how to print ListBox

╄→尐↘猪︶ㄣ 提交于 2019-12-08 02:04:01
问题 I would like to know what is the easiest way to print ListBox's values. I have tried to use FlowDocumentReader but with no success. 回答1: If you are trying to print a visual element,you can use PrintDialog printDlg = new PrintDialog(); printDlg.PrintVisual(ListBox1, "Listbox Printing."); It can be used to print any visual object(any control, container, Window or user control) If you are looking to print the items only then you can use the FlowDocument FlowDocument fd = new FlowDocument();

Unfocused ListBox, item style

天大地大妈咪最大 提交于 2019-12-08 01:45:15
问题 OK, I can't believe there is no online resources about this. I want to do a simple thing and change style of a ListBox item when it's selected and it's parent ListBox has lost focus. We have been using VisualStateManager for this purpose, but since there is overlapping in Selected , SelectedFocused and Focused states, there were some bugs introduced when selecting items holding ctrl for example(wrong items appear selected). I decided to fix it using Trigger s and found out that there seems to

Filter ListBox items based upon textbox from OnKeyUp?

醉酒当歌 提交于 2019-12-08 00:55:29
问题 I have a ListBox containing a large number of items, which are all account numbers and so hard to search through. Is it possible to have the items "filtered" as the user types into a textbox, so that only items that match what has been entered so far are displayed? e.g. List Box 2342 3434 2332 3224 User then enters 3 in the texbox - onKeyUp the listbox is filtered to only display: TextBox 3 ListBox 3434 3224 User then enters a 2 in the box: Textbox 32 ListBox 3224 Is this possible in ASP.Net

Silverlight Listbox Item Style

纵然是瞬间 提交于 2019-12-08 00:42:45
问题 How would one go about styling a listbox such that the selection has a different text color than the default view? I've looked at this in several ways and because the ContentPresenter lacks a Foreground property. The default control template of the listbox provides several rectangles which one can use to adjust the highlight color. For example, with the default style a rectangle called BGColor3 has its opacity adjusted to get a highlight effect. Here is the bulk of my control template: <Grid>

How to stop user from selecting items in a listbox without disabling it

血红的双手。 提交于 2019-12-07 22:53:38
问题 There is something i need to do, list something in WPF but i don't want the users to click on the list, the list box does not have a property to disable selection. You can disable the control, but that's not what i need, because it messes with the styles and makes the text difficult to read. I mean there is something like: <ListBox IsEnabled="{Binding IsValid}" ...> ... </ListBox> I wonder if there is something like: <ListBox Selection="Disabled" ...> ... </ListBox> Or if there exists an