listbox

How can I get a row in Sqlite3 table with Tkinter Listbox widget?

时光怂恿深爱的人放手 提交于 2021-02-20 03:00:06
问题 I have Python program connected to Sqlite3 database with Tkinter on the frontend. My database table (subjectlist) consists of four columns: [id (unique interger), subject (text), serial (unique interger), is_active (boolean interger)]. Here is my program: import sqlite3 from tkinter import * conn = sqlite3.connect('database.db') c = conn.cursor() c.execute('SELECT COUNT() FROM subjectlist WHERE is_active = 1') number = c.fetchone()[0] c.execute('SELECT * FROM subjectlist WHERE is_active = 1

WPF. Binding inside listbox itemtemplate to ObservableCollection source. Source PropertyChanged is ignored

℡╲_俬逩灬. 提交于 2021-02-11 14:29:34
问题 I'm trying to create a ListBox that displays formatted text. I want to be able to change formatting from code. For displaying formatted text I chose TextBlock and intend to use the TextBlock.Inlines collection for formatting. TextBlock.Inlines is not bindable so I created new class BindableTextBlock derived from TextBlock. This class has one dependency property InlineList that I'm trying to bind to InlinesColl ObservableCollection in Model. The problem is that changes in InlinesColl don't

ASP.NET(VB) Listboxes are not moving all the selected items to other Listboxes

自古美人都是妖i 提交于 2021-02-11 12:35:10
问题 The DivisionListBox is used to select values in the SitesListbox as follows: When you select an item in the DivisionListBox it will select all the items on SitesListbox that match the same value. Once the SiteListbox values are selected I use the SiteButton to move all selected values to the empty StoreslistBox successfully. My problem happens when I manually select multiple items on either SiteListbox or StoreslistBox and press SiteButton or StoreButton to move items between Listboxes. It

vba listbox event fires twice

萝らか妹 提交于 2021-02-11 11:49:07
问题 I am trying to get this to work in excel userforms. When selecting a value in the listbox its change event is called twice. Unable to get around it even after putting a flag in place. Not sure why the change event is called twice. After googling it seams like when the control gets focus the change event is called. Below is the code. Public eventsOFF As Boolean Public ctr As Integer Private Sub ListBox1_Change() Dim tmp As String, sel As Variant, s As Variant If eventsOFF Then Exit Sub

Tkinter - How to assign variable to currently selected item in Listbox?

霸气de小男生 提交于 2021-02-11 07:13:31
问题 I need help with a Python3.3 Tkinter scrollable list box that iterates through all the users installed fonts. The purpose of this function is to change the fonts in my Textfield in another part of my program.... from tkinter import * import tkinter.font def fontValue(): fontroot=Tk() fontroot.wm_title('FONTS') fonts=list(tkinter.font.families()) fonts.sort() fontbox = Listbox(fontroot,height=20) fontbox.pack(fill=BOTH, expand=YES, side=LEFT) scroll = Scrollbar(fontroot) scroll.pack(side=RIGHT

Tkinter - How to assign variable to currently selected item in Listbox?

霸气de小男生 提交于 2021-02-11 07:10:46
问题 I need help with a Python3.3 Tkinter scrollable list box that iterates through all the users installed fonts. The purpose of this function is to change the fonts in my Textfield in another part of my program.... from tkinter import * import tkinter.font def fontValue(): fontroot=Tk() fontroot.wm_title('FONTS') fonts=list(tkinter.font.families()) fonts.sort() fontbox = Listbox(fontroot,height=20) fontbox.pack(fill=BOTH, expand=YES, side=LEFT) scroll = Scrollbar(fontroot) scroll.pack(side=RIGHT

Binding textbox in ListView's header datatemplate to a filter property

喜你入骨 提交于 2021-02-10 18:53:54
问题 I am creating a customized listview header that has the header text but also has a textbox that you can enter to filter the content of that column. My code currently looks like this: <UserControl.Resources> <DataTemplate x:Key="myHeaderTemplate"> <StackPanel> <TextBlock FontSize="14" Foreground="DarkBlue" Margin="20,4" Text="{Binding}" /> <TextBox Text="" Margin="4,2" /> </StackPanel> </DataTemplate> </UserControl.Resources> which is the definition for the header datatemplate containing the

Binding textbox in ListView's header datatemplate to a filter property

末鹿安然 提交于 2021-02-10 18:53:24
问题 I am creating a customized listview header that has the header text but also has a textbox that you can enter to filter the content of that column. My code currently looks like this: <UserControl.Resources> <DataTemplate x:Key="myHeaderTemplate"> <StackPanel> <TextBlock FontSize="14" Foreground="DarkBlue" Margin="20,4" Text="{Binding}" /> <TextBox Text="" Margin="4,2" /> </StackPanel> </DataTemplate> </UserControl.Resources> which is the definition for the header datatemplate containing the

How can I disable horizontal scrolling in a Tkinter listbox? (Python 3)

心已入冬 提交于 2021-02-10 16:11:18
问题 Say in Tkinter you have a listbox of a certain size within a window. Then let's say you add a string to that listbox that is larger than that size. If you highlight this element and drag to the side the listbox will automatically "scroll" itself so that you can see the full element. Is there anyway to disable this short of running a thread that repeatedly attempts to set the scroll to 0? import tkinter root = tkinter.Tk() listbox = tkinter.Listbox(root) listbox.insert("end", "Minimal,

Removing a selection from a listbox, as well as remove it from the list that provides it

匆匆过客 提交于 2021-02-09 01:51:35
问题 How can I use the following code to delete a selection from a listbox and removing it from the list the contains it also? The selections in the listbox are dictionaries which I store in a list. .................code.............................. self.frame_verDatabase = Listbox(master, selectmode = EXTENDED) self.frame_verDatabase.bind("<<ListboxSelect>>", self.OnDouble) self.frame_verDatabase.insert(END, *Database.xoomDatabase) self.frame_verDatabase.pack() self.frame_verDatabase.config