listbox

Horizontally oriented listbox using Python and Tkinter

怎甘沉沦 提交于 2020-03-25 19:08:31
问题 I want to provide a listbox where the user can select (multiple) characters (usually close to 15). Quite often some of these will be sequenced, so a listbox is easier than a validated text entry field. Since the character combination has a meaning to the user, it is user friendly to orient the listbox horizontally. Is there an easy way e.g. a theme, setting or subclass of the Tkinter listbox so I do not have to build my own? 回答1: No, there is no setting, subclass or theme that will let you do

Horizontally oriented listbox using Python and Tkinter

落爺英雄遲暮 提交于 2020-03-25 19:08:07
问题 I want to provide a listbox where the user can select (multiple) characters (usually close to 15). Quite often some of these will be sequenced, so a listbox is easier than a validated text entry field. Since the character combination has a meaning to the user, it is user friendly to orient the listbox horizontally. Is there an easy way e.g. a theme, setting or subclass of the Tkinter listbox so I do not have to build my own? 回答1: No, there is no setting, subclass or theme that will let you do

Hidden id on tkInter Listbox

百般思念 提交于 2020-03-19 07:56:44
问题 I'm wondering if it's possible to somehow store a hidden id along with each entry on a Listbox. The reason for this is that I've got a table which contains a unique id which is from a database (not visible to the user but used to uniquely identify each record) I'm caching the table in memory and using a dictionary keyed on the id I'd like to create a Listbox which allows me to select one of the records - the displayed text would not be the unique id but a descriptive field (such as 'Name')

C#: easiest way to populate a ListBox from a List

不想你离开。 提交于 2020-03-12 07:57:09
问题 If I have a list of strings, eg: List<string> MyList = new List<string>(); MyList.Add("HELLO"); MyList.Add("WORLD"); Is there an easy way to populate a ListBox using the contents of MyList? 回答1: Try : List<string> MyList = new List<string>(); MyList.Add("HELLO"); MyList.Add("WORLD"); listBox1.DataSource = MyList; Have a look at ListControl.DataSource Property 回答2: You can also use the AddRange method listBox1.Items.AddRange(myList.ToArray()); 回答3: Is this what you are looking for: myListBox

listbox selected item changed event fired two times

南笙酒味 提交于 2020-03-05 08:05:00
问题 Am using the below code for selected index changed event. Event fired two times i cant able to fix this error . Please help me to fix this error.. This is my code: if (ListBox1.Items.Count > 0) { for (int i = 0; i <= ListBox1.Items.Count - 1; i++) { if (ListBox1.Items[i].Selected == true) { lblempid.Text = Convert.ToString(ListBox1.Items[i].Text.Substring(0, 8)); lblempname.Text = Convert.ToString(ListBox1.Items[i].Text.Substring(9)); DataSet5TableAdapters.sp_GetallpayperiodTableAdapter TA =

Highlight Listbox Function

只谈情不闲聊 提交于 2020-03-04 15:44:44
问题 Im looking for assistance in my code in regards to my listbox highlighting and actively changing the highlighted choice based off active sheet. my listbox auto populates based off the sheets within the workbook and can change active worksheet based off selection but does not auto highlight the initial loaded active sheet as the selection and when manually selected on the workbook does not reflect the changes. Public ActiveSheetChoice As String Private Sub ActiveSheetDisplay_AfterUpdate()

How to Synchronize ListBox SelectedItem and the focused item in WPF?

柔情痞子 提交于 2020-02-25 07:28:45
问题 I create buttons as ListBox items. Using keyboard shortcut, the selected item/button will be changed to the button where the first character is the same with the pressed key. The problem is the focused item (dashed rectangle) will not be synchronized with selected item. This problem doesn't exist if we use keyboard arrow. The shorted code is: <ListBox x:Name="ListBoxRef" ScrollViewer.HorizontalScrollBarVisibility="Disabled" DataContext="{Binding Path=ListViewSource}"

Change selection color of ListBox Item

放肆的年华 提交于 2020-02-07 05:40:05
问题 I have a normal ListBox and I want to change the selection color to Red. Here's what I've got so far. <Style x:Key="myLBStyle" TargetType="{x:Type ListBoxItem}"> <Style.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="red" /> <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="red" /> </Style.Resources> </Style> It's working. The SelectedItem is Red and stay Red even if it's out of focus. Here's my real problem: In my

Vb listbox display in multiply forms?

和自甴很熟 提交于 2020-02-07 05:29:05
问题 I'm using VB.Net and Visual Studio 2012. I need to display the same list box in two different forms. The Scenario I'm creating a program that allows its users to create orders in a cafe. When the user has completed their order they press the button "save/ complete". When they press this button their order is added to a listbox on the side of the new order form. On the other form (summary), there will be the same listbox displayed. So my question is how to display the same listbox on multiple

tkinter multilistbox lists are independent of each other

怎甘沉沦 提交于 2020-02-06 08:41:26
问题 enter image description hereI want to create multiple lists with this code and let the lists I create work with each other. When I make mlb.get (ACTIVE), the value in the list is clicked. The get command is not synchronized with other lists. The info function creates a section on the side and lists the information on the clicked line. The MULTILISTBOX class needs to make lists and work together. import tkinter as tk from tkinter import * from tkinter.ttk import * import apply as apply class