listbox

Detecting if an item is selected or not in a listbox (WPF)

Hi, I want to know how you can know if an item selected or not in the items array of a listbox. The listbox allows multiple selections so I need to iterate all of them and see which are selected and which are not. Many thanks (I know - short and sweet) ...

How do I get all of the values from a GWT multiselect ListBox on a post?

I have a multiselect ListBox in a FormPanel in GWT. I have set the name of the listbox to "foo" via ListBox.setName(). When I post the form, I see that all of the selected values get posted, but all are bound to the same name "foo". So I seemingly cannot get each of the posted values (I am using Django/Python server-side to handle the po...

ListBox.SelectedIndexChanged - can you determine if it was user intiated?

My question is similar to this: http://stackoverflow.com/questions/905447/how-to-prevent-listbox-selectedindexchanged-event, but I want to ask it a different way. Is there a simple way to determine if the 'SelectedIndexChanged' is coming from the user as opposed to initiated through code (e.g. ListBox.SelectedIndex = x)? ...

Force AutoComplete ListBox in a DataGridView on CellEnter

I have a DataGridView with a TextBox column (DataGridViewTextBoxColumn). I already set the AutoCompleteDataSource to a list of string values. Now, the default behavior of the TextBox column is to ONLY show the AutoComplete ListBox when something is typed. Is there a way to show/drop that ListBox on the CellEnter event or as soon as a use...

WPF: Changing the look of a Surface Listbox "click-effect"

Hi, I'm changing the look of some Controls that I use in my Microsoft Surface Application at the moment. And today I'm working on a SurfaceListBox. I have the template for it and already changed background and borders and other stuff. But I really cannot find where I can change the color of the rectangle that appears on the ListBoxItem...

list box control in asp.net

Hello friends I have a list box control in my asp.net project. I want to know how to get selected index to set currently updated item in database. Please help me with this. Do i need to perform some data base operation to find the key for currently updated data and then i'll have to set it or there exist some property to deal with this?...

Making specific text a hyperlink

is it possible to have specific text in a listbox line to act like a hyperlink? dim sLocation as string = "\\server\folder\subfolder\" LstOut.Items.Add("text text text" & sLocation) I would like this to open in explorer. This is not an ASP application, just a plain old winform. ...

How to display text in a ListBox?

I'm using a ListBox to display fairly long text items (500 characters). If an item is too long it will go out the side of the ListBox and not be fully displayed. How can I get items in the ListBox to wrap? Also, is it possible to put some sort of separator between each item? Here is a screen shot with the last item being cut off. ...

Bind ListBox with multiple fields

I am using VS2010 for c#. I have some data there in a table Scores(team1,team2,battingteam,bowlingteam,score) I am using bindingSource to bind it with my listBox. The problem is that i can show only one member in DisplayMember property of listbox (e.g. team1 or team2 only). I want to do something like team1 + " vs " + team2 + ": " + ...

Empty WPF ListBox as Drop Target

I have a ListBox that is a drop target of items from other sources. Everything is working fine except in a particularly situation. When the ListBox has no Items I can only drop in the border of ListBox (I have a trigger so the Border is visible when dragging). To give a bigger drop area I set the MinHeight of the ListBox to 25. When d...

How to update check boxes in a .NET checkListBox?

I've run into a problem where I want to display a list of items in a checkListBox and programmatically check them off one by one as each process I am monitoring gets completed. I will try to water my code down to the bare essentials so everyone can easily grasp what is happening. for (int i = 0; i < 10; i++) { SOME_FUNCTION(); ...

Problem in ListBox ItemTemplate binding using XML as itemssource

I'm having a bit o' trouble... Here is my "mappings.xml" file... <?xml version="1.0" encoding="utf-8"?> <mappings> <mapping QID="info1"> <empty></empty> </mapping> <mapping QID="info2"> <empty></empty> </mapping> </mappings> My method that loads the XML and sets it as the ItemsSource for the listbox: (Note: I didn't ...

Silverlight 4: Listbox doesn't shrink when its items shrink

Hi folks, from this question, I drilled down the problem to a listbox, that doesn't resize, when the Listbox-Items shrink. It resizes accordingly, when the size of the items grow, but it doesn't shrink, when the size of the items decrease. The items can grow/shrink because the items containing textboxes, that resize with the input. J...

Selecting item from ASP.NET listbox using jquery

Greetings, I'm trying to select item from asp.net list box then assign it to a text box so when a click on an item from the list box should appear in the text box. I tried the code listed down but it did not work. please advice how to do this!! ............................ updated code .......................... <%@ Page Language="...

C# Listbox.DrawItem to color each lines

Hello, I have some code to change how listbox act. I can change the color of text, but I am unable to change the color of the background of each line. This is in a for loop for every of my lines LBLines is an array of string store in a global variable if (LBLines[e.Index] != "None") { e.Graphics.FillRectangle(new SolidBrush(Col...

I'm trying to remove empty items in listbox in C#

So i want to remove empty items in listbox like whitespace so Far I have this code. But the compiler is giving me an error for (int i = 0; i < listBox2.Items.Count; i++) { if (listBox2.Items[i].ToString = " "){//ERROR* listBox2.Items.RemoveAt(i); } } *Cannot convert method group 'ToString' to non-delegate type 'bool'. ...

Capturing specific keystrokes from a Listbox

Hello. I'm trying to make my main window to receive notifications when user presses a Delete key on a listbox's item. I've tried this: case WM_CHARTOITEM: if( lParam == (LPARAM)hwndListBox ) { sprintf( debug, "0x%x", LOWORD(wParam) ); MessageBoxA(0, debug, 0, 0); } break; .....

Binding List to Listbox

My listbox is not displaying the items. The items are in a List<string>. Here is the xaml: <DockPanel Margin="10,10,10,10"> <DockPanel.Resources> <local:MyErrors x:Key="myErrors"/> </DockPanel.Resources> <ListBox DockPanel.Dock="Top" ItemsSource="{StaticResource myErrors}" Height="300" Width="250" Margin="0,5,0,10" ...

how to bind actions to a listbox wxpython

so here is my code: import wx from ConfigParser import * class settings(wx.Frame): def __init__(self,parent,id): wx.Frame.__init__(self,parent,id,'Frame aka window', size=(500,500)) panel=wx.Panel(self) configuration = ConfigParser() configuration.read('SerialReader.conf') self.ACTIVE_MES...

WPF Custom Control - How do you bind a listbox from a static ObservableCollection?

I'm not sure how to go about this exactly. I have a static ObservableCollection in the NameField.cs class. I just have no idea how to bind it to the listbox. Should I not be using a ListBox? Should I be using a DependencyProperty? Should I be exposing the ObservableCollection through a property or by public? I'm not sure what to do h...