listbox

Selecting multiple listbox items to set a filter

此生再无相见时 提交于 2019-12-12 03:25:10
问题 I'm trying to select a YEAR and TYPE of business (1 or more) and then autofilter a column. That way I can use only 1 macro instead of making many for all the alternatives. (Year Select) (Type of Business) This is what I have at the moment: Private Sub Botton1_Click() Public Platform As String Public Year as Integer Platform = UserForm1.LB2.Text Year = UserForm1.LB1.value Unload UserForm1 End Sub ...... Private Sub UserForm_Initialize() With LB1 .AddItem "2016" .AddItem "2017" .AddItem "2018"

How to populate a Listbox in C++ with all folders in a directory

六月ゝ 毕业季﹏ 提交于 2019-12-12 03:18:25
问题 I would like to know how to list all folder in a directory in a listbox. I am using Visual C++. 回答1: C++ is a language that does not specify any standard classes or functions for implementing graphical interfaces. It also doesn't provide a standard way of getting lists of files and directories from the operating system!!! In fact...for a long time there wasn't even a standard for string classes, and every project chose different incompatible strings. Note: Even though there's now a standard

Selecting an item from a listbox to show more items in another listbox?

牧云@^-^@ 提交于 2019-12-12 03:16:45
问题 Alright, so i have a problem with my programming, i have three checkedlistboxes, one called " lstShows " 2nd is called " lstSeasons " and third is called " lstEpisodes " and i have two comboboxes that have seasons and episodes in them, one combobox is called " cbSeasons " and 2nd is called " cbEpisodes . so what i'm trying to do is, when i press on an item in lstshows , i want to be able to assign to it items from lstSeasons , and when i want to click on an item in seasons i want to be able

Why I am getting System.Data.DataRowView” instead of real values from my Listbox in vb.net

被刻印的时光 ゝ 提交于 2019-12-12 02:59:06
问题 Could someone help here? I need to extract data from a Database into a combolistbox in VB.net. I have got the data, but now find that The first and the 'x' line need to be removed from the combolistbox (they are validation entries for another software) and shouldn't be selected for this application. I tried to simply remove the offending entries from lists by using :- cbCubeARivet.Items.RemoveAt(index), but had an error letting me know I cannot use "Items" with a DataSource. I decided to send

DataTemplate for Listbox containing lists as items doesn't get displayed

て烟熏妆下的殇ゞ 提交于 2019-12-12 02:58:39
问题 I have the following data template for a list box items: <DataTemplate x:Key="substanceListShower"> <ListBox ItemsSource="{Binding Items}"> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ListBox> </DataTemplate> And then I apply the item template like this: ReactantInterfacesListBox.ItemTemplate = (DataTemplate)FindResource("substanceListShower"); But in the list for the items i get a ToString() return: System.Windows.Controls.ItemsPanelTemplate Any help

C# Displaying a sql database object's name in a label.Text property on “SelectedIndexChanged” Event

巧了我就是萌 提交于 2019-12-12 02:56:32
问题 I am trying to make a small contact book that takes contacts details from a mssql database.It has 3 tables: contacts, last_talk(last time i talked with a contact+short description of the discussion), and another table(that has both primary keys from the first 2 tables ) On the form(tab of tabcontrol) where i display the contacts, i have added 2 listboxes, one loads and displays the contacts names, and the second listbox loads the "Last talk" list for every contact i select depending how many

VB.net Try Catch. Keep the Loop after the Catch

徘徊边缘 提交于 2019-12-12 02:56:28
问题 I'm using Try Catch and I want to add into Form3.ListBoxes the items that are into Form2.ListBoxes in other type. But it stop adding after the Catch the exception. So I want to keep the Loop after the exception be caught! My program get products and show the same products but in another type (Like: I have a T-shirt with a brand, but I want the "same" T-shirt in another brand). ListBox5 are the quantity that I add in Form1. I load Images to be clearly. Form2 Listboxes are in order (ListBox1

counting selected items in a list box

核能气质少年 提交于 2019-12-12 02:56:11
问题 How do you count the amount of values in a list box that are selected, rather than all of those within the list box? I need to get the number and then make it a string. Once i have the number i can change this easily to a string thanks 回答1: yourlistbox.SelectedItems.Count 回答2: I have done this using ListBox1.GetSelectedIndices.Length 回答3: You can loop through the items in the listbox like so: For Each item As ListItem In MyListBox.Items If item.Selected Then 'Do something End If Next 来源:

How to delete a registrykey when selecting on listbox?

喜你入骨 提交于 2019-12-12 02:54:42
问题 I have added all startup programs to a listbox. How can I delete the selected registry key when I select the item and click on a button? Listbox code: private void starting() { RegistryKey HKCU = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run"); { foreach (string Programs in HKCU.GetValueNames()) { startupinfo.Items.Add(Programs); } HKCU.Close(); } RegistryKey HKLM = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run"); {

Arrange 2 List<string> to list box

巧了我就是萌 提交于 2019-12-12 02:54:15
问题 i have 2 List that i want to put into my Listbox the first List contain names and the second contain numbers my problem is that some of the names long so the numbers cannot a display in the same line how can i put in in appropriate way ? listBox.Items.Add("Name" + "\t\t\t" + "Number"); for (int i = 0; i < lists.Count; i++) { listBox.Items.Add(lists._namesList[i] + "\t\t\t" + lists._numbersList[i]); } Update here is what I tried with a ListView listViewProtocols.View = View.Details;