listbox

Unexpected behavior with Python3 / Tkinter and two Listboxes bound to ListboxSelect event

泄露秘密 提交于 2019-12-02 12:47:47
I’ve encountered an unusual problem in a script that I’m working on. The program is written in Python3/Tkinter. It initializes two Listboxes, wrapped in two separate Frames, and according to the user’s commands displays either one or the other. An exception arises when the user selects on one of the items in the first Listbox, then decides to change screen and selects an item in the second frame. I’ve created a sample code (below), to replicate the problem. With this code, during runtime, clicking on one item in the first Listbox (white background) makes the second Listbox appear (orange

Displaying information in messagebox from listbox

徘徊边缘 提交于 2019-12-02 12:41:00
I am writing a program that requires me to select a home address from a listbox. When i click on the display button a messagebox is supposed to appear and display the address and several other bits of information stored in an array list for that address. I am fairly unfamiliar with listboxes and can't figure out how to display all this information in a messagebox from one selection in a listbox. You can get the selected item value in a ListBox string curItem = listBox1.SelectedItem.ToString(); you may handle the onClick event of your btn, then show information in a message box MessageBox.Show

Reversed Listbox without sorting

Deadly 提交于 2019-12-02 12:03:11
问题 I spent last two weeks trying to figure out a method to display the items of a listbox in reversed order without using any sort property and without putting any presentation logic in my entities, I just want that the last inserted item is displayed at the top of the listbox. The only pure XAML solution I've found is this WPF reverse ListView but it isn't so elegant. I've also tried to override the GetEnumerator() of my BindableCollection (I use Caliburn Micro as MVVM framework) to return an

Slow showing / drawing dialogue with ListBox?

戏子无情 提交于 2019-12-02 12:02:18
My application uses entity framework to pull in a small tiny set of results... It takes about 3 seconds for it to do it? Why might this be? Start.cs ... private void projectToolStripMenuItem_Click(object sender, System.EventArgs e) { NewProject newProjectForm = new NewProject(); newProjectForm.ShowDialog(); // It seems to take about 3 or 4 seconds to actually get to this :S } ... NewProject.cs public partial class NewProject : Form { private EFProjectTypeRepository projectTypeRepository; public NewProject() { projectTypeRepository = new EFProjectTypeRepository(); InitializeComponent();

How to use UI virtualization with redefined ListBox templates

谁都会走 提交于 2019-12-02 11:58:44
问题 I'm trying to use ListBox as a view containing multiple items and, of course, I need to use UI virtualization in it. The problem is virtualization works only when I declare ListBox this way: <ListBox ItemsSource="{Binding ItemsSource}" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling"> <ListBox.ItemTemplate> <DataTemplate> <views:SiteEntryView /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> But if I try to customize it, it doesn't

How can i know if a ListBoxItem is the last item inside a Wpf's ListBox?

眉间皱痕 提交于 2019-12-02 11:42:12
问题 How can i know if a ListBoxItem is the last item of the collection (in the ItemContainerStyle or in the ItemContainer 's template) inside a Wpf's ListBox ? That question is because I need to know if an item is the last item to show it in other way. For example: suppose i want to show items separated by semi-colons but the last one: a;b;c This is easy to do in html and ccs, using ccs selector. But, how can i do this in Wpf? 回答1: As it seems to be rather difficult to implement an "Index"

How do I change the color of a word inside a listbox

↘锁芯ラ 提交于 2019-12-02 11:29:11
问题 I made a Form with a TextBox that accepts a word and searches a bunch of sentences to see if any of them contains that word .After that I have to appear those sentences and highlight the word .My plan is to make a ListBox and add the sentences inside of it. My problem is how to highlight the word (by changing the color I suppose) so it can be distinguished. Is there a preferable way? I chose ListBox so I can select the sentence I'm looking for. Edit According to @Thorsten Dittmar directions a

How to turn Listbox to Text for Excel VBA

旧街凉风 提交于 2019-12-02 11:19:34
I am trying to automatize an e-mail, but I am having a problem when I try to send lines from listbox; I have tried a few different ways none that were even close to working. In addition, I don't know how to use the column. I am currrently tryying to get it to work via Dim listboxarr() Dim i As Integer For i = 1 To 500 ' v this is a listbox With selecteditems listboxarr(1) = .List(i, 1) End With Next i This code throws me: Subscription out of Range This is the code for the email: Private Sub addcb_Click() Dim iCtr As Long For iCtr = 0 To Me.allitems.ListCount - 1 If Me.allitems.Selected(iCtr) =

How to import data from one column of Excel to listbox using C#

独自空忆成欢 提交于 2019-12-02 11:13:00
I have an openFileDialog tool. I will choose a excel file from my computer and my programme read a column (for example A column) and write my listbox on GUI. How can i do it via OleDB? I am new at C#. If you explain detailed, I will be happy for that. Thank you for your help. In order to use the OLEDB provider successfully we have to consider a few points. The OLEDB provider for Excel 2003 files is different from the one used for Excel 2007/2010 files. So, the first thing we have to do is determining the Excel file format in order to select the correct provider. In the code example below I

How do I get the index of a listboxitem in a WPF listbox instance?

浪尽此生 提交于 2019-12-02 10:59:16
问题 The listbox is databound, binding to a collection of XML nodes through xmldataprovider. 回答1: I had a similar question which was answered here Basically you set the ListBox's AlternationCount to something really high, and bind to the AlternationIndex on each item <ListBox AlternationCount="100"> <ListBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(ItemsControl.AlternationIndex)}" /> </DataTemplate> </ListBox.ItemTemplate> <