listbox

Get Selected Item from Windows Phone listbox in Hold event

拟墨画扇 提交于 2019-12-13 02:17:07
问题 I have a pretty basic Listbox in my Windows phone 8 app. It's not data bound to anything, it's just an empty listbox. <ListBox Margin="0,10" Name="lstStops" SelectionChanged="favouriteSelection" Hold="favouriteSelectionHold" FontSize="28"> <ListBox.Items> </ListBox.Items> </ListBox> I want to be able to give the user the option to delete items from this list by pressing and holding on the item. I have added an onHold event which is firing when the user presses on an item in the list and holds

How do i add same string to a ListBox in some lines?

浪子不回头ぞ 提交于 2019-12-13 01:43:22
问题 In the top of the Form i have: string[] data; Color []color; In the constructor: color = new Color[1] { Color.Red}; Then i have a function i load in the constructor: private void ListBoxLoadKeys(Dictionary<string,List<string>> dictionary, string FileName) { string line = System.String.Empty; using (StreamReader sr = new StreamReader(keywords)) { while ((line = sr.ReadLine()) != null) { int i = line.Count(); tokens = line.Split(','); dictionary.Add(tokens[0], tokens.Skip(1).ToList()); //

Tkinter - can't find package treectrl

廉价感情. 提交于 2019-12-13 01:33:07
问题 Well I wanted to try using multi-column ListBox in Tkinter , and I came to find " TkTreectrl" which was suggested here, but the problem is, when I try using it and creating a MultiListbox , I'm getting this error: "_tkinter.TclError: can't find package treectrl" Any ideas what to do? thanks! 回答1: Download 64 or x86 bit tktreectrl (depending upon system arch) from this below link : https://sourceforge.net/projects/tktreectrl/files/tktreectrl/tktreectrl-2.4.1/ Put it in tcl folder (e.g your

Click item in listbox and View details in multiline textbox

社会主义新天地 提交于 2019-12-13 01:08:20
问题 I would like to click on an item in a listbox and display the attributes that were passed into that listbox to a multiline textbox. Below is the code I have written on form initialisation public Form1() { InitializeComponent(); ReadFromFile.Read("sample.GED"); foreach (KeyValuePair<int, Individual> kvp in ReadFromFile.individuals) { listBox2.Items.Add("ID = " + kvp.Value.id + " Name = " + kvp.Value.name.givenName + " " + kvp.Value.name.surname + " DoB = " + kvp.Value.birth.date); } int

Multiple Columns in listview

余生颓废 提交于 2019-12-13 00:41:07
问题 I am writing the following code in C# to show data in multiple columns in a listView but it only shows the first element of the array, ListViewItem item = new ListViewItem(new []{txtTitle.Text,txtRatings.Value.ToString(),cmbGenre.Text}); lstMovie.Items.Add(item); the output in the list view is just the first element. How do I get all three elements. 回答1: The data was inserted but listview was not displaying it, set listView's View property to Details lstView.View = View.Details; 回答2: Have you

How to change the value of the currently selected item in the list box?

会有一股神秘感。 提交于 2019-12-13 00:40:43
问题 I know one can get the value of the currently selected item like this: var myListBoxItemText = $('#myListBox').val().toString(); But how do you change this value in the list box to something else? 回答1: Seeing your update in the comments, here's an updated answer. Just use the :selected selector to filter the options inside of your select element to get the selected option. To change a select element's selected option's value property: $('#myListBox option:selected').val('new value'); To

“List index out of bounds” on TListBox

眉间皱痕 提交于 2019-12-13 00:38:03
问题 I have a TListBox on a form, and items are added with listbox1.ItemIndex := listbox1.Items.AddObject('msg', TObject(grp)); grp is an integer. The listbox is set to lbOwnerDrawFixed . In the onDrawItem event I get the exception EStringListError raised on the marked line: msg := (control as Tlistbox).Items.Strings[index]; // this line works grp := integer((control as Tlistbox).Items.Objects[index]); // exception here msg and grp are local string and integer variables. Project ### raised

ASP.NET List Box

放肆的年华 提交于 2019-12-12 23:02:00
问题 I am creating a web site in which one page has a list box in which set of names will be displayed.There s another box next to this box.User should be able to select few names from the first list,hit a arrow button,doing which all the selected names of first box will appear on the second box. Can anyone please help me out as to how to do this?? 回答1: Suppose that id of the ">>" button is btnLoad and its click event handler is btnLoad_Click lst1 is First List box and lst2 is Second list box:

ListBox not highlighting selection on tab change

老子叫甜甜 提交于 2019-12-12 21:33:34
问题 I'm currently trying out C# and WPF for the first time. I have a window with two tabs, tabA and tabB . Each tab has a list box (they are almost identical), tabA has listboxA and tabB has listboxB . When an item in a list box is selected, some information about the item is shown, so that I know that it is selected. On a certain event E , I want an item in listboxA or listboxB to be highlighted and selected, which one is determined by the logic in my application. Scenario A is that I am

How do I draw a line between ListBoxItems

╄→гoц情女王★ 提交于 2019-12-12 19:49:26
问题 I want to be able to separate each item in a listbox with a horizontal line. This is just some of my code for drawing the items. private void symptomsList_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) { bool selected = ((e.State & DrawItemState.Selected) == DrawItemState.Selected); int index = e.Index; Graphics g = e.Graphics; Color color; if (selected == true) { color = Color.Red; } else { color = Color.Pink; } /* Draw Background */ g.FillRectangle(new SolidBrush(color),