listbox

How to get multiple selected items in listbox wpf?

馋奶兔 提交于 2019-12-12 07:19:23
问题 I am confused on how to retrieve multi selected values from listbox in wpf. In XAML I have the following listbox with selection mode multiple. <ListBox Height="100" HorizontalAlignment="Left" Margin="139,207,0,0" Name="listBox1" VerticalAlignment="Top" Width="120" SelectionChanged="listBox1_SelectionChanged" SelectionMode="Multiple" /> <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="319,220,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />

Excel vba list box multi column multi row from 14 text boxes

别等时光非礼了梦想. 提交于 2019-12-12 06:42:21
问题 I have user form with 14 text boxes , 2 command buttons " next " , " Post " and 1 list box I need code to get the data from the 14 text boxes to the list box , again when the user enter new data and press next this data added to second row in the list box , gain , again finally when he press post all data move to work sheet " Database" Sub CommandButton1_Click() Dim arr1, i As Long Dim arr2(0 To 0, 0 To 13) arr1 = Array(TB10, TB10, TB0, tb1, cb1, cb2, tb5, tb4, TB10, TB10, TB10, tb6, tb7, tb8

Keeping Selected Listbox Item through re-write

孤街浪徒 提交于 2019-12-12 06:39:41
问题 I have a function that updates listbox entries by removing and re-inserting them with an updated counter, however difficulty arises when I try to maintain a highlighted item, as it has been removed there is nothing to highlight. My question is how can I get the program to remember what was highlighted? Code: #!/usr/bin/python from time import clock, sleep from os import system from collections import defaultdict from subprocess import PIPE, Popen from threading import Thread, Lock import

Adding Items to a listBox in a Windows Forms Application,

不问归期 提交于 2019-12-12 06:38:27
问题 How I can add Items from two textBoxes and a radioButton (there are two but only one can be checked) to a listbox if you perfomed a click on a button? This is my code: listBox1.Items.Clear(); for (int i = 1; i < listBox1.Items.Count; i++) { if (textBox1.Text == listBox1.Items[i].ToString()) { equal1 = true; } else { equal1 = false; break; } } if (equal1 == false) { listBox1.Items.Add(textBox1.Text); } for (int i = 1; i < listBox1.Items.Count; i++) { if (textBox2.Text == listBox1.Items[i]

pass listbox item to a textbox on another form c#

孤街浪徒 提交于 2019-12-12 06:33:49
问题 I am making this simple Windows forms app in Visual studio in c#. I have two forms. On form1 I have a textbox,listbox and two buttons (one to insert into listbox from textbox and another to open form2). On form2 I only have a textbox. I just simply want, when click on a button (for opening form2) on form1, form2 to open and textbox to contain (on formLoad) selected item from listbox from form1. But when I click on button it says "Object reference not set to an instance of an object". What am

show vector elements in listbox

戏子无情 提交于 2019-12-12 06:28:24
问题 I would like to display the elements in a vector in a listbox. However, I'm constantly getting a error: error C2664: 'System::Windows::Forms::ListBox::ObjectCollection::Add' : cannot convert parameter 1 from 'std::basic_string<_Elem,_Traits,_Alloc>' to 'System::Object ^' I am using windows form in c++/cli. this is the code: for (size_t z = 0; z < container.size(); z++){ listBox_name->Items->Add(container[z]); } 回答1: Based on the error message, your vector is a vector of std::string . Use

Trying to move Checkbox Items in Gridview to Listbox with a “Select” button method

﹥>﹥吖頭↗ 提交于 2019-12-12 05:32:52
问题 I am working on an assignment that is asking me to use code to create a gridview with a checkbox. After doing so, I am to take the checkbox items selected (through a button click) over to the listbox to display the values as text. The sample page is here: http://aspnet.cob.ohio.edu/mis3200/asppub/MIS3200/Unit8/bobcat8POS.aspx My code so far is this: protected void btnSelect_Click(object sender, EventArgs e) { lblAlready.Text = string.Empty; // empty the label that says you already have an

AutoHotkey type entries from ListBox

孤街醉人 提交于 2019-12-12 05:29:58
问题 I am new to AutoHotkey and have no programming experience, so sorry to ask what to many of you may be a very mundane question. One of my main uses for AutoHotkey will be to complete data in records I keep from an AutoHotkey ListBox. Using replies to other forum questions I have a working script as follows: :*:\lb:: Gui, Add, ListBox, h100 vLB, apple||bannana|cantaloup|kiwi|orange|pomegranate|strawberry Gui, Add, Button, Default, Input Gui, Show return ButtonInput: Gui, Submit SendInput, %LB%

C# - Listbox Remove part of line

柔情痞子 提交于 2019-12-12 05:28:40
问题 I have a listbox that has contents that look like this: C44 EXCLUDES 237.910 193.469 0 0603_5 C45 EXCLUDES 244.102 193.387 0 0603_5 R47 EXCLUDES 226.935 179.519 90 0402_2 C18 CAP-00129G 230.960 190.619 0 0402_4 C17 CAP-00129G 250.085 198.569 90 0402_3 C25 CAP-00130G 255.635 189.669 90 0402_3 C56 EXCLUDES 229.430 189.374 0 0402_4 R42 EXCLUDES 241.010 192.194 90 TANT3216 R10 EXCLUDES 246.560 203.894 0 0402_9 On the click of a button, I would like to "REMOVE ENDINGS" and re-upload it to the

NameError: global name is not defined' creating error when it has been defined

一笑奈何 提交于 2019-12-12 05:25:12
问题 im trying to create a program that will load a file (called lines.txt), add lines to it and will remove them, im using tkinter as a gui. i cannot however finish the add_line section as it always returns "NameError: global name is not defined' creating error when it has been defined.", it is defined on line 29 as listbox = Listbox(root) , the section it is failing at is in def Add_Barcode(self): in def Add(self): on line 95. listbox.insert(END, term) from tkinter import Tk, Frame, Menu import