combobox

dropdown event/callback in combo-box in pyqt4

£可爱£侵袭症+ 提交于 2019-12-24 01:54:49
问题 is there a callback or event for dropdown in pyqt4 combo box? Just like self.connect(self.ui.combobox,SIGNAL("activated(int)"),self.refresh 回答1: The QCombobox uses a QAbstractItemView (QListView by default) to display the dropdown items (accessible via the view() property). I am not aware of any signal for that purpose. But you can set an eventFilter that will do the trick by using installEventFilter on the view of the combobox and implement the eventFilter method: from PyQt4 import QtCore,

Know what option in combobox is selected in C#?

筅森魡賤 提交于 2019-12-24 01:54:31
问题 I have a combobox and have a list of things in it....the amount of things in the list is not set. It is gathering data from a folder and you can have an infinite (a little exaggeration) amount of items in the combobox...how do I know which option a user selects? I tried the code below but it doesn't work. I'm brand new to C# and don't know what I'm doing wrong. comboBox1.SelectedIndex = 0; comboBox1.Refresh(); if(comboBox1.SelectedIndex = 0) { //setting the path code goes here } 回答1: Edit:

My c# ComboBox does not call the getter after selecting an item. Why?

懵懂的女人 提交于 2019-12-24 01:39:59
问题 I have an Combobox with SelectedItem. If I select an item my setter does some calculation and perhaps I want to reset the value to the old one. Unfortunatly my view does no refresh. I have the following ComboBox : <ComboBox BorderThickness="0" VerticalAlignment="Center" Margin="2,0" DisplayMemberPath="Name" ItemsSource="{Binding ItemsVS.View}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" > </ComboBox> Here are the properties of my ViewModel: private CollectionViewSource _itemsVS; public

Remove duplicates from combobox which is bind to dataset

試著忘記壹切 提交于 2019-12-24 01:14:51
问题 I have a xml file in my project. I am reading the file through the below code in to combobox cbProduct . The problem is that the cbProduct is displaying duplicate text values. How to make them distinct? I have gone through some links but there way of approach is not related to dataset. I implemented the below code: DataSet ds = new DataSet(); ds.ReadXml(@"..\..\stock.xml"); cbProduct.DataSource = ds.Tables[0]; cbProduct.DisplayMember = "productname"; optional : If you have time it will be

Setting combobox values on initialisation and change of other comboboxes

痴心易碎 提交于 2019-12-24 00:53:53
问题 (EDIT: To clarify, I'm running Excel 2013, so Microsoft's date picker isn't available.) I'm trying to code a simple date picker - it'll be tidier when it's done, it's just big for simplicity while I build it - and everything populates as it should: Me.Combo_Year.List = wsLU.Range("Date_Years").Value Me.Combo_Month.List = wsLU.Range("Date_Months").Value Me.Combo_Day.List = wsLU.Range("Date_Days31").Value However, there are two instances where I'd like to set default values for the year, month

How to get an ExtJS ComboBox to display inline with text?

倾然丶 夕夏残阳落幕 提交于 2019-12-24 00:41:20
问题 I want to get the following to display in a single line. I have tried using styles float and display. Show this input <input type="text" name="filterOp" id="filterOp"/> inline. <script type="text/javascript"> new Ext.form.ComboBox({ applyTo: 'filterOp', triggerAction: 'all', name: 'item', mode: 'local', lazyInit: true, displayField: 'name', valueField: 'id', forceSelection: true, typeAhead: true, inputType:'text', fieldLabel: 'Item selection', style: "display: inline-block", store: new Ext

How do I remove options from a dropdownlist in javascript?

最后都变了- 提交于 2019-12-24 00:35:31
问题 Are there any examples out there that will allow me to remove options from drop down list using JavaScript? Here is the code: <select autocomplete="off" id="sSec1" tabindex="0" name="sSec1" class="isSelected styled security selectOriginal"> <option id="" value="">Select</option> <option id="o1" value="What is the name of your first pet?">What is the name of your first pet?</option> <option id="o2" value="What is your favorite food?">What is your favorite food?</option> <option id="o3" value=

c# combobox binding and first null value

放肆的年华 提交于 2019-12-24 00:33:53
问题 I got probably a small problem but can't find workaround... I have a combobox on a winform, and this combobox has binding to a column in a datatable. This column (keeps printer name) is null value allowed. I want the combobox to display a first value string "default" and then the printers list. But I don't want "default" string to be stored in datatable, just null. cmbDefaultPrinter.DataSource = this.availablePrinters; cmbDefaultPrinter.DisplayMember = "Display"; cmbDefaultPrinter.ValueMember

WPF Combobox loses Text after Selection

馋奶兔 提交于 2019-12-24 00:32:37
问题 I would like to have a searchable combobox. When I type something into it, the itemlist gets filtered. OnTextChanged does this quite fine. The second part is, inside the comboboxlist all the items are displayed with their shortdescription, but when I select an item, I want the key to be displayed. On SelectionChanged should do that, but everytime I select an item, the combobox input field gets overwritten with "". private void OnTextChanged(object sender, TextChangedEventArgs e) { ItemSource

Wait until user has stopped typing in ComboBox to run macro (VBA)

拥有回忆 提交于 2019-12-24 00:26:41
问题 I'm programming a sort of cross-reference database. An ID is generated based on the document name chosen or created. The ComboBox I've referred to in the title acts on change (after 3 letters), checks the database for similar entries to what was typed, and displays the drop downof options that match. Once an entry is picked from the match list or a new name created - the appropriate number is generated. Since the DropDown list is generated after every letter is typed, it takes a while to type