listbox

KeyDown event is not working for Arrow keys, Home, End, PageUp, PageDown and other similar keys in silverlight

∥☆過路亽.° 提交于 2019-12-07 20:46:28
I want to override the selection behavior of ListBox Items. We can traverse through ListBox items using Up and Down arrows but I want to traverse the list using Left and Right arrow keys. While I am trying to add the key down event for ListBox, It shows almost all key presses except for Arrow Keys, Home, End and similar keys. I have the following code: private void listArtist_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { if (e.Key.ToString() == "Enter") { // Go to some page } else { MessageBox.Show(e.Key.ToString()); } } I am clueless about this. Please help. Thanks, Subhen

Get a RETURN from a Invoke method

别说谁变了你拦得住时间么 提交于 2019-12-07 20:30:16
问题 I am trying to read value from a listbox item that is on another thread. I tried to make a new method to run the invoke command, I can manage to send a command to the listbox like add via the invoke method but i cant seem to get a response, i cant seem to get the value of the item, i have tried a few ways, once i change it from a void to a string things start to get hairy... thread t1 = new thread(thethread) t1.start() public void thethread() { string text = readListBoxSelected(listBox1) + "

Wp8:Not able to get checkBox in listbox

拜拜、爱过 提交于 2019-12-07 19:46:27
问题 I am not able to find checkbox in listbox xaml: <ListBox x:Name="my_list" Grid.Row="0"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" > <CheckBox x:Name="cbx_state" Tag="{Binding}"/> <TextBlock x:Name="txt_string" Text="{Binding}" VerticalAlignment="Center" FontSize="34" /> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ListBox> I am trying to get cbk_state so that i can set its checked property.The function i used to get the checkbox is private

WPF ListBox with CheckBox data template - Binding Content property of Checkbox not working

走远了吗. 提交于 2019-12-07 18:50:18
问题 I am following Kelly Elias' excellent article on making a WPF checkListBox. However, in my case, I have to create my objects in code using reflection. The ListBox item source is populating appropriately and the data template is styling the ListBox correctly, resulting in a list of CheckBoxes, but no Content is being shown for the CheckBox. What am I doing wrong with the binding in my data template? For brevity here, see the link above for the CheckedListItem class; mine is unchanged. The

Disabling “Drag Selection” on ListBox

牧云@^-^@ 提交于 2019-12-07 17:58:37
Winforms' ListBox appears to have a strange behavior. When I set the SelectionMode to one, I expect that I can click an item, and it becomes selected. This holds true, but if I click an item, drag up and down the list, the selection changes. Now, that wouldn't be too much of a big deal except that I need to perform drag and drop between some controls. So, when they select an item, and drag it down the list, a newly-selected item is actually the one it registers as dragging, and the wrong item gets sent over. So, I then further bandage it by saving a reference to the selected item on mousedown,

Two Way Binding on Multi-select WinForms Listbox?

扶醉桌前 提交于 2019-12-07 17:55:31
问题 I have a project where we are loading a multi-select listbox from a collection of objects. I have another entity object that has a collection that I want to bind to SelectedItems somehow. Is there any way to do this using object binding sources or some kind of binding source without writing code? Sure I can loop through the collection and get the selected items but I'd prefer to do it more cleanly with windows data-binding. Is this possible? 回答1: Unfortunately you can't bind the SelectedItems

Delphi TListBox iOS making new itemstyle/behavior

隐身守侯 提交于 2019-12-07 17:00:53
问题 I need to show custom data. For example I need to show a contact list with name, description, photo. And ideally I would also like to show custom data there, e.g. a button to launch telephone call. The default styles do not quite do what I want, but fairly close. Thus, as far as I can tell, TListBox could be a decent control for this if I could create custom styles? Is that possible? (Anotther problem of course is setting the values of the custom data controls.) 回答1: You should take a good

ASP.NET jQuery double listbox edit and save

允我心安 提交于 2019-12-07 16:50:06
问题 Okay - so I have been pulling out my hair on this one for far too long now. Hopefully you guys can help out. I have a form that allows a user to input/edit data about their company. Most of it is pretty straight-forward form field editing, but I have one part where I am allowing the user to select what state(s) their business operates in and then assign a contact to that state. I am using jQuery and 2 listBox controls where I allow the user to double-click the state(s) they want to operate in

WPF: How to programmatically give visual feedback that the keyboard focus is in a listbox?

牧云@^-^@ 提交于 2019-12-07 16:42:46
问题 I am writing an application with a listbox allowing multi-selection (SelectionMode=Multiple); the items in the lisbox are ingredients for a recipe. Unfortunately, clicking on a listbox item selects this item, which may not be desired. I would like the following scenario: the user clicks on the listbox in order to select the listbox (the listbox itself, not an item) the user scrolls to the right item and selects it What I did is style the ListBoxItem to include a checkbox and a

Best way to stretch WPF ListBox.ItemTemplate's contents to the width of ListBoxItem

ぐ巨炮叔叔 提交于 2019-12-07 16:41:05
问题 I know this may be duplicate, but I haven't found a best solution. I simply come across a issue of using ListBox.ItemTemplate, I want the content Grid to HorizontalAlignment=" Stretch "(not work). So I tried to bind the Grid' Width to the ListBoxItem , but the last item behaves strangely. If bind to the Width of ListBox , there will be a scrollbar, although a converter may solve it, I think there must be some more simple and elegant solution. Codebehind: public partial class MainWindow :