combobox

WPF Change Window Layout Based on Combo Box Selection Using MVVM

拟墨画扇 提交于 2019-12-25 08:34:27
问题 I need to change the layout of my window based on what the user selects in a combo box. I've made a stab at what one way might be but feel like it is clunky and hacked together. Im certain their must be a cleaner MVVM solution. My thoughts where to have multiple dock panels in my GroupBox Whose visibility is set to collapse. When the selection is made, the appropriate dockpanel will be set to visible. I attempted to find a way to do this inside the view model with no success. I also couldn't

Binding ObservableCollection to DataGrid ComboBox?

爱⌒轻易说出口 提交于 2019-12-25 08:27:33
问题 I am trying to bind the items of the ComboBox with an ObservableCollection, I have been successfully binding them to a StaticResource , The XAML, Nursing_Home_Name is the SQL Server Table and this code works fine for me. <Window.Resources> <local:CollectionsLists x:Key="StaticNursingHomeList" /> </Window.Resources> <DataGridTemplateColumn Width="120" Header="施設名称"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding UpdateSourceTrigger=PropertyChanged, Path=Nursing

JAVAFX ComboBox is blank

故事扮演 提交于 2019-12-25 08:14:23
问题 I am very new to programming and can't seem to get past this hiccup. I would like to have a choicebox that is populated with options and that is present immediately. I have tried defining the ObservableList and then creating a ComboBox but it is empty when I actually run the code. I do not need to edit this array after it appears. Here is my code: ObservableList<String> options = FXCollections.observableArrayList( "Option 1", "Option 2", "Option 3" ); @FXML final ComboBox stores = new

how to retrieve the newly added item to vaadin combobox with a button click

落花浮王杯 提交于 2019-12-25 07:59:46
问题 My problem is a simple one. I am trying to add a new Item to a Vaadin ComboBox, which is already populated with some data, by clicking a button. I want the newly added item to be available in the button click event handler so that I can add the same to database table. ComboBox region = new ComboBox(); for (RegionDetails details : regions) { int regionId = details.getRegionId(); String regionName = details.getRegionName(); region.addItem(regionId); region.setItemCaption(regionId, regionName);

WPF combobox transparent background not working with Windows 10

左心房为你撑大大i 提交于 2019-12-25 07:49:17
问题 I have to define a combobox through code behind: var cmbLogin = new ComboBox() { Width = 200, Height = m_dFontSize + 10, FontSize = m_dFontSize, Margin = new Thickness(20), BorderBrush = new SolidColorBrush(m_ExeCfg.GetForeground()), HorizontalContentAlignment = HorizontalAlignment.Center, Background = Brushes.Transparent,<--------------HERE Foreground = new SolidColorBrush(m_ExeCfg.GetForeground()), Focusable = true, }; so the background gets transparent in win7 but not in win10. I have seen

Powershell refresh CheckBox array from ComboBox

二次信任 提交于 2019-12-25 07:47:18
问题 With Powershell, I have a form with several tabs. In the third tab, I make an array of numbers picked from Windows registry that I'll put in a ComboBox. Then I make automatically several CheckBox by registry value names depending the ComboBox. My problem is that I can't refresh/update the CheckBox when I change the text of the ComboBox. I tried ".Refresh()" like below and other things, but it doesn't work. Here are my registry keys: Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER

Trying to connect a comboBox in word to a database in Access using Visual Basic

三世轮回 提交于 2019-12-25 07:28:48
问题 I've been working on this for the past 6 hours and I'm getting a frustrating error. For now, I want to add a combo box into my blank word document and populate it with a data from a field in a table I created in Access. I'm using Visual Studio 2015 as my IDE and the Word 2013 Document Template. ERROR An exception of type 'System.Runtime.InteropServices.COMException' occurred in WordInvoice.dll but was not handled in user code Additional information: Provider cannot be found. It may not be

adding two columns to vba userform combobox

℡╲_俬逩灬. 提交于 2019-12-25 07:23:37
问题 i have that userform for stock control which used to in or out items, all i want to do to amend the below code to show each item name beside it`s code to make searching items. Code: Private Sub ComboBox1_Click() Dim i As Integer Dim j As Integer Dim final As Integer Dim FINAL2 As Integer For i = 2 To 1000 If Hoja5.Cells(i, 1) = "" Then final = i - 1 Exit For End If Next For i = 2 To 1000 If Hoja6.Cells(i, 1) = "" Then FINAL2 = i - 1 Exit For End If Next For i = 2 To final If ComboBox1 = Hoja5

comboBox输入智能匹配

為{幸葍}努か 提交于 2019-12-25 07:12:35
rivate void comboBox1_TextUpdate(object sender, EventArgs e)//TextUpdate事件 { string[] data = new string[] { "张三", "李四", "王五", "赵六", "田七","张三丰","铁拐李","王大麻子" }; comboBox1.Items.AddRange(data); comboBox1.TextUpdate += (a, b) => { var input = comboBox1.Text.ToUpper(); comboBox1.Items.Clear(); if (string.IsNullOrWhiteSpace(input)) comboBox1.Items.AddRange(data); else { var newList = data.Where(x => x.IndexOf(input, StringComparison.CurrentCultureIgnoreCase) != -1).ToArray(); comboBox1.Items.AddRange(newList); } comboBox1.Select(comboBox1.Text.Length, 0); comboBox1.DroppedDown = true; //保持鼠标指针形状

subform combobox rowsource update - how update drop down list

折月煮酒 提交于 2019-12-25 06:53:32
问题 I have a treeview control on an MS Access form. A subform combo box control's list of values depends on the node selected in the treeview on the main form. I am trying to achieve refresh of the combo box drop down list contents on the subform as follows: Public Sub TreeView1_nodeClick(ByVal node As Object) subForm.Controls("Bid").RowSource = "... newquery depending on tree node values ..." subForm.Controls("Bid").Requery End Sub But oddly enough, this does not update the list of values. A