combobox

ComboBox not losing focus

自作多情 提交于 2020-01-03 12:17:20
问题 I've been having problems with the ComboBox control. I'm no expert in GUI, but I know this problem is related to the control's focus. For some reason, the ComboBox does not lose its focus when I click outside of it. Say for example: I click on the ComboBox to list its items. I select one item. This closes the ComboBox. I click on the second ComboBox, the first one stays focused. OR Click on a ComboBox (contains Point, Solid and Wireframe). Click on the form. Press either P, S or W. See the

JavaFX combobox not refreshing the number of visible rows

左心房为你撑大大i 提交于 2020-01-03 08:45:15
问题 I'm changing the items on a combo-box dynamically. It's working perfectly, except that the number of visible rows remains fixed according to the first time the combo-box is clicked. Example: The combobox items are set to A and B. When I click the combobox, it shows 2 rows with A and B. Then I change dynamically the items to C, D and E. When I click the combobox, it shows 2 rows with C and D and a scrollbar. I already set the comboBox.setVisibleRowCount(10); but it keeps showing only 2 rows

Update a datagridview having combobox with bindingsource

廉价感情. 提交于 2020-01-03 05:55:42
问题 I am using Vb.Net to load data from sql server database. I have the car datatable as follows: I load car details and distinct model values as follows: sql = " select * from car" daCar = New SqlDataAdapter(sql, sqlConn) daCar.Fill(dsDataset, "car") sql = " select distinct model from car" daCar = New SqlDataAdapter(sql, sqlConn) daCar.Fill(dsDataset, "model") Now when I load the form I have two bindingsources and have one combobox to display the distinct values of the model so user car modify

How to enforce distinct selections when multiple ComboBox's are bound to a common source?

一笑奈何 提交于 2020-01-03 05:24:08
问题 In my WPF app i have 4 comboboxes. They all are populated this way; combobox1.ItemSource = dt.DefaultView; combobox1.DisplayMemberpath = "Name"; combobox2.ItemSource = dt.DefaultView; combobox2.DisplayMemberpath = "Name"; and so on for combobox3 and combobox4 . This dt (DataTable) already contains distinct Names as I am fetching records using distinct Name . Now what should I do so that when a Name is selected from combobox1 it should not be available in other 3 comboboxes list. I read a

Populating a combobox in Word from Excel - stops working after Excel file is moved

梦想的初衷 提交于 2020-01-03 05:15:14
问题 Thanks for your time! Using snippets of code gathered here on stackoverflow and elsewhere, I was able to cobble together a macro that will populate a combobox in Word from a defined range of data in an Excel file, and then get a label to print the second column from the combobox (which is too long to display in the combobox itself). So far, so good. Here's my code: Private Sub ComboBox1_DropButtonClick() 'Late binding. No reference to Excel Object required. Dim xlApp As Object Dim xlWB As

Showing data from related tables in single datagridview

半城伤御伤魂 提交于 2020-01-03 03:11:11
问题 I have some tables in the db: Items Manufacturers Categories Cities Regions ============== ================ ============ ======== ========== ItemId ManufacturerId CategoryId CityId RegionId ManufacturerId CityId NameCategory RegionId NameRegion CategoryId NameManufacturer NameCity NameItem Weight I am displaying the list of the items in DataGridView using this code: DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter("select * from Items", connectionString); SqlCommandBuilder

Detecting user selection in ComboBox.DropDownClosed in winforms

折月煮酒 提交于 2020-01-03 01:42:29
问题 I have several comboboxes in a UI each with a long list of similar entries (numbers). When the user selects an item from one of the comboboxes, I know the user will choose an entry with a similar value (but likely not the same) from the other comboboxes. Thus, after the user has selected a value, to help avoid forcing the user to do a lot of scrolling, I would like to "pre-scroll" the next combobox dropdown to the vicinity of the last selected value (when this dropdown does not already have a

How do I set a ComboBox default *not in the drop down* when a list item begins with the same text as a drop down item?

*爱你&永不变心* 提交于 2020-01-03 00:32:33
问题 Using C#, say you have a ComboBox that has a DropDownStyle set to DropDown (there are items in the drop down but the user can manually enter a value as well). How do you set a default value for the ComboBox that is not in the list of values in the drop down, but begins with text from a possible selection? Normally setting ComboBox.Text works fine, but if there is an item in the drop down that begins with the text you want as the default, it automatically selects the first item in the list

Silverlight MVVM, stop SelectionChanged triggering in response to ItemsSource reset

ぐ巨炮叔叔 提交于 2020-01-02 23:11:08
问题 I have two ComboBoxes, A & B, each bound to an Observable Collection. Each has a SelectionChanged trigger is attached which is intended to catch when the user changes a selection. The trigger passes the selection to a Command. The collections implement INotifyPropertyChanged in that, in the Setter of each, an NotifyPropertyChanged event is fired. This is needed (in the MVVM approach) to notify the UI (the View) that the ComboBox's contents have changed. The two ComboBoxes are interdependent -

ComboBox Simple with Bitmap

懵懂的女人 提交于 2020-01-02 14:32:19
问题 How do I put a bitmap in a combobox with style set to simple? For example, Google Chrome has the star on the right, Firefox has the arrow on the right. I tried this code: procedure TForm2.ComboBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); var ComboBox: TComboBox; bitmap: TBitmap; begin ComboBox := (Control as TComboBox); Bitmap := TBitmap.Create; try ImageList1.GetBitmap(0, Bitmap); with ComboBox.Canvas do begin FillRect(Rect); if Bitmap.Handle <> 0