combobox

Modify a structure field containing combobox when SelectedIndex event fires

╄→гoц情女王★ 提交于 2020-01-06 02:25:28
问题 I am trying to have a generic widget composed of a label and a value. The value is set by a combobox. Here is the structure: Structure tParam Dim label As Label Dim comboBox As ComboBox Dim valueX As String End Structure Dim parameter1 As tParam I'd like to modify the valueX as the SelectedIndexChanged event is fired. For now I have set parameter1.label.text = "Id" parameter1.comboBox.Tag = parameter1 ' the struct itself AddHandler parameter1.comboBox.SelectedIndexChanged, AddressOf

Non-store value ExtJs

…衆ロ難τιáo~ 提交于 2020-01-05 23:47:12
问题 So I'm trying to create an 'abnormal' combobox using ExtJs 4 and I'm running into a slight issue which I can't figure out how to resolve. I got the basics down with the code that follows. As of right now I am able to get the dropdown to show all the addresses in a proper format and when I click on the proper address it properly shows the 'Street1' value in the input. Here is what I'm stuck on: I'm trying to add an initial item to the combobox that basically says something like 'Add New

Binding WPF ComboBox to enum and hiding certain values

大憨熊 提交于 2020-01-05 17:38:53
问题 I have a WPF combobox that is bound to an enum like this: <Window.Resources> <local:EnumDescriptionConverter x:Key="enumDescriptionConverter"/> <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="cityNamesDataProvider"> <ObjectDataProvider.MethodParameters> <x:Type TypeName="local:MyModel+CityNamesEnum"/> </ObjectDataProvider.MethodParameters> </ObjectDataProvider> </Window.Resources> <ComboBox x:Name="cityNameComboBox" ItemsSource="{Binding Source={StaticResource

Binding WPF ComboBox to enum and hiding certain values

二次信任 提交于 2020-01-05 17:37:50
问题 I have a WPF combobox that is bound to an enum like this: <Window.Resources> <local:EnumDescriptionConverter x:Key="enumDescriptionConverter"/> <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="cityNamesDataProvider"> <ObjectDataProvider.MethodParameters> <x:Type TypeName="local:MyModel+CityNamesEnum"/> </ObjectDataProvider.MethodParameters> </ObjectDataProvider> </Window.Resources> <ComboBox x:Name="cityNameComboBox" ItemsSource="{Binding Source={StaticResource

Two-way binding with Windows Forms ComboBox throws NullReferenceException when changed

不问归期 提交于 2020-01-05 12:02:32
问题 I have a Windows Forms application, and one of the forms has a couple of ComboBox es that are both bound to the same BindingList of objects I have mapped via Entity Framework. The Form_Load event calls this: private void SetFacilityDropdowns() { dbContext.Facilities.Load(); var bindingSource = dbContext.Facilities.Local.ToBindingList(); Dictionary<ComboBox, string> selectedDropDownsAndBoundFields = new Dictionary<ComboBox, string> { {FacilityId, DataConstants.Facility.FacilityId},

Two-way binding with Windows Forms ComboBox throws NullReferenceException when changed

时间秒杀一切 提交于 2020-01-05 12:01:53
问题 I have a Windows Forms application, and one of the forms has a couple of ComboBox es that are both bound to the same BindingList of objects I have mapped via Entity Framework. The Form_Load event calls this: private void SetFacilityDropdowns() { dbContext.Facilities.Load(); var bindingSource = dbContext.Facilities.Local.ToBindingList(); Dictionary<ComboBox, string> selectedDropDownsAndBoundFields = new Dictionary<ComboBox, string> { {FacilityId, DataConstants.Facility.FacilityId},

WPF Border for ComboBox

◇◆丶佛笑我妖孽 提交于 2020-01-05 10:05:01
问题 I try to use a ComboBox based on ToolBar.ComboBoxStyleKey. It has a flat design. Control by default does not have a border, i.e., on a white background is only visible icon of ToggleButton. How can I add border for control when focus isn't on ComboBox? Thanks! No focus: Mouse hover: 回答1: There is a Border control in WPF, you could use that to wrap around your ComboBox. <Border Background="GhostWhite" BorderBrush="Gainsboro" BorderThickness="1"> <ComboBox> ... </CombodBox> </Border> http://www

WPF Border for ComboBox

╄→гoц情女王★ 提交于 2020-01-05 10:03:06
问题 I try to use a ComboBox based on ToolBar.ComboBoxStyleKey. It has a flat design. Control by default does not have a border, i.e., on a white background is only visible icon of ToggleButton. How can I add border for control when focus isn't on ComboBox? Thanks! No focus: Mouse hover: 回答1: There is a Border control in WPF, you could use that to wrap around your ComboBox. <Border Background="GhostWhite" BorderBrush="Gainsboro" BorderThickness="1"> <ComboBox> ... </CombodBox> </Border> http://www

Writing information from Combo-box to text file

前提是你 提交于 2020-01-05 09:04:40
问题 I am trying to right the information from a combobox into a text file so it can be saved. If the information in the combobox is John, Marry, Jack I would like it to appear in the text file like this: John Mary Jack The code I currently use give a result of JohnMaryJack in the text file For Each item As Object In cmbworld.Items Dim test As String test = item sb.AppendFormat("{0}", item) Dim FILE_NAME As String = "D:\Documents\test.txt" If System.IO.File.Exists(FILE_NAME) = True Then Dim

Two values inside a combobox in vb

帅比萌擦擦* 提交于 2020-01-05 08:52:35
问题 i want to create a combobox with two fields inside. so far, this is my code. it can only display the area number but i want to display also the area name in a single line. can anyone help me with this? any help will be greatly appreciated. thank you so much Sub getarea() Try Call MyConnection() Sql = "select AREA_NO as 'Anum', AREA_NAME as 'Aname', AREA_LOCX as 'Alocx' from area" Dim cmd As New MySqlCommand(Sql, Con) Dim reader As MySqlDataReader reader = cmd.ExecuteReader Try Dim comboarea