listbox

Adding XML elements to ListBox

大城市里の小女人 提交于 2019-12-25 05:06:07
问题 I don't know how to convert the type for name so that each element in it can be added to my ListBox. If someone could help that would be much appreciated. XDocument doc = XDocument.Load(workingDir + @"\Moduleslist.xml"); var names = doc.Root.Descendants("Module").Elements("Name").Select(b => b.Value); listBox1.Items.AddRange(names); I'm getting an error on AddRange(names) saying invalid arguments 回答1: names is IEnumerable<String> and listBox.Items.AddRange is expecting an object array and

tkinter : How to create a listbox that can appear and disappear over another widget without moving the other widget?

泄露秘密 提交于 2019-12-25 05:03:13
问题 Question: I would like to create a listbox that would appear and disappear below label1 but it should not affect the position of label2, when label1 is clicked. How can this be done? Background: I have written a test code (see below) to show my problem. On 1st mouse click, listbox appears but pushes label2 downwards. On 2nd mouse click, listbox hides but label2 remains in new location and does not return to original position. I have tried using .grid_forget() but got the same behaviour.

ListBox Selected Items are reset each time I switch tabs in may TabControl

泪湿孤枕 提交于 2019-12-25 04:50:13
问题 I have the following TabControl: <TabControl Name="tabControl" Grid.Row="0" MinWidth="270" HorizontalAlignment="Stretch" ItemsSource="{Binding Counters}" ContentTemplate="{StaticResource templateForTheContent}" ItemTemplate="{StaticResource templateForTheHeader}"> </TabControl> It uses this DataTemplate: <Window.Resources> <DataTemplate x:Key="templateForTheContent" > <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Grid

Populating 2nd+ column of listbox on Excel worksheet

拈花ヽ惹草 提交于 2019-12-25 04:47:18
问题 I have an ActiveX listbox on an Excel 2007 worksheet. I want to populate it directly, not by pointing its RowSource property to a range, because there is no range that has the desired values. The listbox's ColumnCount is set to 2. I set ColumnWidths to "20;20", and now it returns: 20 pt;20 pt So as far as I understand, two columns in the listbox should be available for writing, right? Populating the first column is no problem: activesheet.lstApplyCurves.List = array("Select All","Deselect All

Show “pop up window” when is mouser over listBox item

让人想犯罪 __ 提交于 2019-12-25 04:45:10
问题 I bind observable collection on listBox. I have data tempate on listbox item. It consit one image control and som textBlock. If is mouse over on some listBox item I would like achieve this behavior: Show PopUp/ToolTip (some "rectangle" with controls) and bind values from listBox current item. And on textBox in item data template I have style, I would like change color of text in textBlock, for example from black to green. Style is here: <Style x:Key="FriedNickStyle" TargetType="TextBlock">

Jquery Listbox / Textbox filter

£可爱£侵袭症+ 提交于 2019-12-25 04:39:10
问题 I have the following jquery function for filtering the contents of a listbox on the onkeyup event from a textbox. function DoListBoxFilter(listBoxSelector, filter, keys, values) { var list = $(listBoxSelector); var selectBase = '<option value="{0}">{1}</option>'; list.empty(); for (i = 0; i < values.length; ++i) { //add elements from cache if they match filter var value = values[i]; if (value == "" || value.toLowerCase().indexOf(filter.toLowerCase()) >= 0) { var temp = String.format

Scrolling list items in wpf

為{幸葍}努か 提交于 2019-12-25 04:29:22
问题 I guess the following picture depicts the problem better than texts... alt text http://img179.imageshack.us/img179/8949/samplescrollingitems.png That is what I need. <ListBox x:Name="NamesListBox" ItemsSource="{Binding}"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <WrapPanel x:Name="ItemWrapPanel"> <WrapPanel.RenderTransform> <TranslateTransform x:Name="ItemWrapPanelTransformation" X="0" /> </WrapPanel.RenderTransform> <WrapPanel.Triggers> <EventTrigger RoutedEvent="WrapPanel.Loaded">

Comparing two list box and displaying the differences (VB.net)

人盡茶涼 提交于 2019-12-25 04:24:50
问题 Hello I am having troubles with my application. I am trying to load a list into listbox1 and then refresh the same list in listbox2 (but with possibly different results) and then compare the two and display in textbox1 the differences between the two list boxes. I have gotten to a point where I am able to tell if there are differences but when it goes to post into the textbox it displays the entire listbox and not the differences. That's a little wordy. Sorry. Below is my code: TextBox1.Text

How to add some buttons to selected ListBox item via style?

孤者浪人 提交于 2019-12-25 04:14:08
问题 Is there a way to add some buttons to the selected ListBoxItem by adding these buttons to a style which is being used for the selected item? I didn't yet find a suitable style FMX uses to display the selected item. My goal is to have some buttons on the selected item with context based functionality. While I can do this by reparenting a TButton created in code in the OnPaint event of the ListBox, this works for Android but not for Win32 as it is being overpainted by the selection. Other

Check List Box before Adding New Item

强颜欢笑 提交于 2019-12-25 03:52:53
问题 I am trying to check that an item doesn't already exist in a list box before I add the new item. if (TeamNameTextBox.Text != "") { if (TeamNameListBox.Items.FindByValue(TeamNameListBox.Text) == null) { TeamNameListBox.Items.Add(TeamNameTextBox.Text); TeamNameTextBox.Text = ""; int teamCountUpdate = TeamNameListBox.Items.Count; if (teamCountUpdate == 1) { TeamCount.Text = teamCountUpdate.ToString() + " Team"; } else { TeamCount.Text = teamCountUpdate.ToString() + " Teams"; } } else {