listbox

How to attach extra data to listbox items in VB.Net

萝らか妹 提交于 2020-01-06 14:56:56
问题 i'm new to visual studio and working on a project in visual basic. I am additing data to listbox from database that i need to access later.. Can we add extra data to listbox items as we can do with following html ?? <option name="harry" age="10" value="1">My name is harry</option> any ideas please ??? regards 回答1: You don't "attach" any data (whatever that means) to any UI elements in WPF, simply because UI is not Data. If you're working with WPF, you really need to understand The WPF

Getting listbox items to display to another form

↘锁芯ラ 提交于 2020-01-06 14:01:56
问题 I'm still new here so please consider. My question is that I have two forms, (form1 and form2). In form1 there's a listbox with customers names on it. Now what i want is when the user clicks a name on the listbox, a new form (form2) pops up and displays the rest of the information of the customer (age,address,phone number) on the textboxes. When I click a name on the listbox it displays the rest of the info but only on that form, I can't get it to display on another form. I'm coding it using

Getting listbox items to display to another form

你离开我真会死。 提交于 2020-01-06 14:00:19
问题 I'm still new here so please consider. My question is that I have two forms, (form1 and form2). In form1 there's a listbox with customers names on it. Now what i want is when the user clicks a name on the listbox, a new form (form2) pops up and displays the rest of the information of the customer (age,address,phone number) on the textboxes. When I click a name on the listbox it displays the rest of the info but only on that form, I can't get it to display on another form. I'm coding it using

Removing duplicate items (string) from listBox

一个人想着一个人 提交于 2020-01-06 13:55:29
问题 I'm a university student doing a project for a unit. We're creating a web application dashboard, and I can't seem to remove duplicates from a listBox (customerNameListBox). public partial class Graphs : System.Web.UI.MasterPage { string FullDataCSV = Path.Combine(HttpContext.Current.Server.MapPath ("~/App_Data/Full_Data.csv")); List<CSVEntry> CSVList = new List<CSVEntry>(); public void ReadFile() { try { StreamReader inputFile; string line; CSVEntry entry = new CSVEntry(); char[] delim = { ',

asp.net ListBox deselect item

别来无恙 提交于 2020-01-06 05:46:25
问题 I'm usting an asp:ListBox and I understand that to deselect items the user needs to hold down control while clicking on a selected item. Is there a way to make it that clicking on a selected item will deselect it without holding down control? 回答1: You can, but not in ASP.Net. You need to change the client-side HTML, meaning you need to code it using Javascript, to change the default behaviour or a select box. Something like: <script> function MyHandle(oSelect) { (change behaviuor here, using

Need List Box values to be displayed in cell after clicked

核能气质少年 提交于 2020-01-06 03:34:04
问题 I have a Form Control list box with multiple iteams. I would like a certain cell on the spreadsheet to display the contents of the list box item the user selects and change if the user makes a different selection. Not sure where to even start with this. 回答1: I guess you already know how to write to a cell: Set TxtRng = ActiveWorkbook.Sheets("YourSheet").Range("A1") TxtRng.Value = "Your Text Here" And the following piece of code would go into your ListBoxChanged-Event , so the cell displays

WPF: use a ListBox in a template that will be the template of another ListBox

可紊 提交于 2020-01-06 02:54:08
问题 I have a ListBox whose ItemSource is an ObjectDataProvider that is an instance of an ObservableCollection. The ObservableCollection is a collection of ObservableCollections. The ItemTemplate of the ListBox is a DataTemplate that creates a ListBox for each item of the listbox. To illustrate this better I'm trying to recreate a card game in WPF. Basically, from a hand of cards you can create books. After you have a valid book, you can elect to make it a book which will go into the

Right alignment of items in Windows.Forms.ListBox

↘锁芯ラ 提交于 2020-01-05 10:39:13
问题 Is there a proper way to align items to the right for ListBoxes from the .net Windows.Forms? You can use example_box = ListBox() example_box.RightToLeft = RightToLeft.Yes This enables the right alignment, but also prints your items right to left. Also the formatting does some really strange things here: '% one two 4.72' gets displayed as 'one two 4.72 %' For digits only this works quite well, but feels rather wonky. Are there better solutions? 回答1: RightToLeft layout is meant for the Arabic

Hiding A Listbox Item in WPF

荒凉一梦 提交于 2020-01-05 08:40:34
问题 I have a ListBox control populated with several ListBox items. Each item contains a "Proceed" button and a "Postpone" button. I would like to hide that ListBox item (presented as a row in my case) once the "Postpone" button is clicked. The code I have currently doesn't seem to have any effect. XAML: <ListBox.ItemContainerStyle> <Style TargetType="{x:Type ListBoxItem}"> <Style.Triggers> <DataTrigger Binding="{Binding PostponeClicked}" Value="1"> <Setter Property="IsEnabled" Value="False"/> <

Hiding A Listbox Item in WPF

旧巷老猫 提交于 2020-01-05 08:39:08
问题 I have a ListBox control populated with several ListBox items. Each item contains a "Proceed" button and a "Postpone" button. I would like to hide that ListBox item (presented as a row in my case) once the "Postpone" button is clicked. The code I have currently doesn't seem to have any effect. XAML: <ListBox.ItemContainerStyle> <Style TargetType="{x:Type ListBoxItem}"> <Style.Triggers> <DataTrigger Binding="{Binding PostponeClicked}" Value="1"> <Setter Property="IsEnabled" Value="False"/> <