listbox

How to find the lowest, highest and average values in a listbox [closed]

一个人想着一个人 提交于 2019-12-02 23:31:32
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I'm trying to create a program that calculates and displays the highest, lowest and average value of items in a listbox (items generated from a txt file). I finally figured out how to load a text file to the listbox. I have been searching for clues for about an hour and all my attempts have brought me to a dead

How to Remove selected item from listbox C#

♀尐吖头ヾ 提交于 2019-12-02 21:46:17
问题 i currently trying to view all the files and folder selected by the user in a listbox. At the Moment i am able to list what the user have chosen using the openfiledialogue HOWEVER i am now facing prob when i try to remove it form the listbox. i trying to allow the user to click on the checkbox beside the file and press the remove button to remove it this is my code for remove button private void button2_Click(object sender, EventArgs e) { for (int i = listView1.SelectedItems.Count - 1; i >= 0

Displaying information in messagebox from listbox

一曲冷凌霜 提交于 2019-12-02 21:04:55
问题 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. 回答1: You can get the selected item value in a ListBox string curItem = listBox1.SelectedItem

WPF listbox copy to clipboard

大兔子大兔子 提交于 2019-12-02 20:54:29
I am trying to copy a standard WPF listbox selected Item (displayed) text to clipboard on CTRL+C. Is there any simple way to achieve this. If it is something that works for all the listboxes int he app.. that would be great. Thanks in advance. As you're in WPF so you could try the attached behaviours First you need a class like this: public static class ListBoxBehaviour { public static readonly DependencyProperty AutoCopyProperty = DependencyProperty.RegisterAttached("AutoCopy", typeof(bool), typeof(ListBoxBehaviour), new UIPropertyMetadata(AutoCopyChanged)); public static bool GetAutoCopy

Equally outlining listbox values in C# with the PadLeft function

元气小坏坏 提交于 2019-12-02 20:11:48
问题 I am wrestling with my listbox and values in the listbox for some time now and I stumbled across another problem. I am fetching data from my Access database (both the field names and the values) and displaying them in a listbox. I am trying to outline the values of the field names to the right of the field name on a equal distance (so they are all below each other). I am trying to use the PadLeft function for this but for some reason this doesn't outline them below each other. I think this

Adding file path to listbox item

寵の児 提交于 2019-12-02 19:54:26
问题 I'm trying to store the file path in a tag of a listbox item. I'm using the below to search through and add the desired folder name to the list box I've added the ListBox1.Tag = sDir line to above the first Next and when I step thorugh the code the value of sDir appears to hold the path however if I create a simple Double click event that pops up a message box with the file path in it only shows the first folder name in the list. Any tips or advice - I basically want to select a Listbox item

Run throguh visual tree and set all Images to null

百般思念 提交于 2019-12-02 19:30:41
问题 I saw tons of threads with memory leaking while using images. So, is it a good idea just to have a general function, some kind of own GC, which would run at NavigatingFrom, find all images (even in templates of virtualized lists) and set them to null? 回答1: Here is an helper to iterate throught all the images of your page: public IEnumerable<Image> GetAllImage(DependencyObject root) { var count = VisualTreeHelper.GetChildrenCount(parentElement); for (int i = 0; i < count; i++) { var child =

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

為{幸葍}努か 提交于 2019-12-02 18:50:01
问题 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,

Slow showing / drawing dialogue with ListBox?

妖精的绣舞 提交于 2019-12-02 18:46:37
问题 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;

Direct Uploading New Ftp listbox Lines

点点圈 提交于 2019-12-02 18:06:46
问题 Can i (Upload / Adding) Listbox Lines To Current Ftp listbox Lines Server Without download Previous ftp server Listbox value. Instead of Uploading addition listbox lines To Ftp Listbox Lines Server ! Can I simply send listbox new lines and then it Added to currently listbox ftp server lines (without remove old lines, it only add new lines) With currently Ftp listbox Lines without me having to download and upload the whole ftp listbox? Example : That's My Code Download Code (Button 1) [not