combobox

Change width of dropdown listbox of a ttk combobox

被刻印的时光 ゝ 提交于 2021-02-05 04:44:17
问题 I am trying to change to width of the popdown list of the ttk Combobox. Setting the width of the Combobox also changes the width of the Listbox, making part of the values unreadable. I read this solution in Tk/Tcl but I am not familiar with this language and would like to solve the problem with Python. I tried changing the theme parameters but it does not seem to help. Below is a piece of sample code. import tkinter as tk from tkinter import ttk root = tk.Tk() root.title("testing the combobox

Dynamically update Combobox after selecting item in another ComboBox - JavaFX

时间秒杀一切 提交于 2021-02-04 20:59:21
问题 I have a JavaFX form with two combo boxes populated with Times in 15 min increments for Start and End times. I am trying to get the End time combo box to dynamically repopulate with options when the user selects a start time so that it is not possible for the user to select an End time before the start time while preserving the user's selection if the user has already selected an end time that is still after the start time. I have been able to get both boxes to populate correctly and

MVVM WPF ComboBox SelectedItem Binding not activated inside datagrid

穿精又带淫゛_ 提交于 2021-02-04 14:49:26
问题 I have struggled to save my combobox selected value when operating inside a datagrid. When I make a test solution with no datagrid things are working ok. The context are person names with associated countries. The countries are stored in a xml file. Here is a snapshot of the initial view: You see here the (important parts of the)PersonList.xaml: <UserControl.Resources> <XmlDataProvider x:Key="Dataxml" Source="\Properties\AllCountries.xml" /> <model:Person x:Key="Person"/> </UserControl

How to change background color in ttk.Combobox's listview?

≡放荡痞女 提交于 2021-02-04 13:51:25
问题 How can I change the style of the combobox's listview? Here is part of the code so far: style = ttk.Style() style.configure("BW.TLabel", foreground="black", background="#20252b", insertbackground="white", fieldbackground= 'blue') optmn = ttk.Combobox(self, style="BW.TLabel") optmn.place(x=140, y=200, width=150, height=25) How can I access the style of the listview of the combobox? Sample Image: 回答1: Found it! the way to change the BG of the listview of the combobox is: import ttk import

ComboBox.SelectedValue is null in the Form's constructor

谁说我不能喝 提交于 2021-02-04 08:01:48
问题 I generated a very simple code snippet: public partial class Form1 : Form { public Form1() { InitializeComponent(); dt = new DataTable(); dt.Columns.Add("ID", typeof(int)); dt.Columns.Add("Title", typeof(string)); dt.Rows.Add(1, "One"); dt.Rows.Add(2, "Two"); cmb = new ComboBox(); cmb.DropDownStyle = ComboBoxStyle.DropDownList; cmb.DisplayMember = "Title"; cmb.ValueMember = "ID"; cmb.DataSource = dt; this.Controls.Add(cmb); cmb.SelectedValue = 2; } } When I set the value cmb.SelectedValue ,

VBA Automation - Prefilling Combodate Box

早过忘川 提交于 2021-02-02 09:55:30
问题 I am trying to prefill data from Excel to a local intranet website via VBA. I've been able to prefill most data to the site, but I am struggling with this combodate box: Please see HTML code: <div class="form-group row " id="starttime_field"> <label class="col-form-label col-md-3" for="starttime">Start time</label> <div class="col-md-9"> <input type="text" id="starttime" name="starttime" class="form-control" size="30" style="display: none;"><span class="combodate"> <select class="hour " style

Make a dropdown type Combobox behave like an Edit control

≡放荡痞女 提交于 2021-01-29 22:24:07
问题 I'm about to replace a standard edit control with a dropdown type combo box. So basically that combobox bahaves like exactly like an edit control. Everything works fine so far but there is just one notable difference: When you click on the edit control containing already some text and that doesn't have the focus, the cursor is simply positioned where you click. But when you click on a the combo box containing already some text and that doesn't have the focus, the whole text is selected. This

Parent/Child ComboBoxes

若如初见. 提交于 2021-01-29 20:30:42
问题 I have 2 combobox, each having different items but somehow it's a hierarchy of characteristics of the next combobox ie: Combobox1 has VEHICLES, MOTORBIKES and NONE as items. I want to be able to choose Vehicles in combobox1 and Combobox2 updates with items only associated with vehicles ie Sportscar, Sedan etc. The same should happen when I choose Motorcycles in combobox1, it should update combobox2 with items only related to motorcycles. 回答1: Put this sample code inside the ComboBox1

Parent/Child ComboBoxes

若如初见. 提交于 2021-01-29 17:37:19
问题 I have 2 combobox, each having different items but somehow it's a hierarchy of characteristics of the next combobox ie: Combobox1 has VEHICLES, MOTORBIKES and NONE as items. I want to be able to choose Vehicles in combobox1 and Combobox2 updates with items only associated with vehicles ie Sportscar, Sedan etc. The same should happen when I choose Motorcycles in combobox1, it should update combobox2 with items only related to motorcycles. 回答1: Put this sample code inside the ComboBox1

Cannot invoke “javafx.scene.control.ComboBox.getItems()” because the return value of “Controller.getMyBox()” is null

為{幸葍}努か 提交于 2021-01-29 14:10:06
问题 Somehow, I cannot add items to my ComboBox variable from another class as it always says either the value of variable is null or the return value of its getter is null. I use Scene Builder to build Sample.fxml, with controller as Controller class, luanch the whole thing form UserInterface class FXML <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.control.ComboBox?> <?import javafx.scene.layout.BorderPane?> <BorderPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http:/