Click here to Skip to main content
15,881,803 members
Everything / ListControl

ListControl

ListControl

Great Reads

by Jovibor
Owner-draw list control with tooltips, editing, colors, sorting, hyperlinks, columns hiding and lot more.
by Nilay M Joshi
Multiselect Combobox - Custom control for WPF
by Jovibor
List Control with tooltips, cells editing, colors, sorting, hyperlinks, columns hiding, and a lot more
by Måns Tånneryd
How to get WPF ListBox items with the same look-and-feel as items in a WPF ListView.

Latest Articles

by Jovibor
List Control with tooltips, cells editing, colors, sorting, hyperlinks, columns hiding, and a lot more
by Nilay M Joshi
Multiselect Combobox - Custom control for WPF
by Jovibor
Owner-draw list control with tooltips, editing, colors, sorting, hyperlinks, columns hiding and lot more.
by Rolf Kristensen
A custom draw CListCtrl with subitem editing and formatting

All Articles

Sort by Score

ListControl 

6 Apr 2020 by Jovibor
Owner-draw list control with tooltips, editing, colors, sorting, hyperlinks, columns hiding and lot more.
26 May 2021 by Nilay M Joshi
Multiselect Combobox - Custom control for WPF
17 Mar 2024 by Pete O'Hanlon
You cannot tell if an object has been changed using an ObservableCollection. The way to do this is to use INotifyPropertyChanged and raise the PropertyChanged event whenever you change the value in a property.
2 Nov 2011 by LanFanNinja
Try this:int[,] result = {{ 2,3,7 }, {2,3,5 } ,{2,3,6},{ 2,4,7 }, {2,4,5 } ,{2,4,6}};List numberArrays = new List();for (int i = 0; i
10 May 2023 by Jovibor
List Control with tooltips, cells editing, colors, sorting, hyperlinks, columns hiding, and a lot more
31 Oct 2011 by Måns Tånneryd
How to get WPF ListBox items with the same look-and-feel as items in a WPF ListView.
22 Aug 2013 by Richard MacCutchan
Use the CListBox::SetCurSel[^] function to clear the selection, probably in the OnKillFocus[^] override.
17 Jan 2011 by Manfred Rudolf Bihy
A ListBox has display strings those are the ones you see in the GUI and associated with each of these display strings is a value. So the DisplayMember of ListControl gives you the string as you see it in your GUI and the ValueMember property of ListControl (ListBox is derived from ListControl)...
28 Apr 2013 by P Uday kishore
Am not able to drag the column header in list control whats is the issue with it??can any one help me regarding this...
30 Apr 2013 by Leo Chapiro
Take a look: VC++ MFC Tutorial: CListCtrl, InsertItem, Using List Control, SetImageList, Article with source code[^]>can we have any other option to increase or decrease the column width of virtual list control.Yes, we can:// The pointer to my list view control.extern CListCtrl*...
8 Oct 2015 by Ramza360
First it makes a copy of the text in the DataTextBox.Text property.string data = DataTextBox.TextThen instantiates a new List, with the data returned by the Split call.List gradeString = new List(data.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries));The...
14 Apr 2016 by Jochen Arndt
It is not quite clear what you are looking for but I will try to answer.If you want to make updating the list items faster, you can disable redrawing while inserting and changing items:// Disable redrawing while updating the listSetRedraw(FALSE);// Add or update items...
17 Apr 2016 by Richard MacCutchan
That is the way that Windows works. Your repeated calls to moveform is preventing the updates from getting actioned until the loop terminates, and you start pulling messages from the queue.
31 Jul 2018 by Jochen Arndt
See the description of the NM\_CLICK (list view) notification code | Microsoft Docs[^]: Quote: The iItem member of lParam is only valid if the icon or first-column label has been clicked. To determine which item is selected when a click takes place elsewhere in a row, send an LVM_SUBITEMHITTEST...
7 Dec 2018 by OriginalGriff
First off, mastermind has two different scores: Black and White. Black is where a letter is correct, and in the right place. White is where a letter is correct, but in the wrong place. So "this" and "that" would be 2 Black, 0 White. And "this" and "here" would be 0 Black, 1 White. So do this in...
8 Sep 2020 by Richard MacCutchan
The documentation (Tuple types - C# reference | Microsoft Docs[^]) shows how to make tuples with more elements.
13 Dec 2022 by CPallini
Quote: I want to write shorter condition than this Python y = (website[-4:]!=".com" and website[-4:]!=".net" and website[-4:]!=".org" and website[-4:]!=".gov" and website[-4:]!=".edu") y = not (website[-4:] in site)
17 Jan 2011 by Seyed Hamed Khatami
Hi!Can somebody please explain to me what the ValueMember property of the ListBox class does?Thanks in advance!
12 Feb 2011 by zison
Now there are many listbox or listctrl control use process bar ,combobox ...as item;but i want a list control use dialog as item,Is there somebody had seen this kind of control?can u give me a url?thank u!
12 Feb 2011 by Andrew Brock
I dont know if this will work, but take a look at embedding dialogs in things like tab controls. There is an article here[^] which does it simply.Then take a look at an article that embeds something else in a listctrl. A pretty simple one can be found here[^].Then just change the row...
13 Feb 2011 by Nish Nishant
This seems rather odd for an UI. If you just want to show a read only dialog there, you may not need to embed a dialog. Instead use custom drawing/painting to show all the data you want to, and make it look like a dialog.On the other hand if you want to get an editable dialog in there,...
15 Feb 2011 by zison
Thanks everyone !I decide to use the Rollup Control.Although It is not as suitable as i think,but if i modify it ,it will be ok. :-\
2 Nov 2011 by katerinaPapathak
Hi to all I'm new in C# and programming and my problem is to convert a 2d-array into a List. My goal is to store in list items the rows from the array. What I've tried so far is the above public static List GetMyNumbers(int[,] result) { int[,] res =...
2 Nov 2011 by Pandya Anil
for(int i=0;i{ int[] newRow = new int[result[i]]; for(j=0;j { newRow[j] = result[i,j]; } list.add(newRow);}mark as answer if solves your problem
27 Jun 2012 by usmanali.ali843
Hi everyone! Can Anyone please helpout me that how can i show selected Item in A Generic base Un ordered List text at the top of listi mean to say that let suppose we have an unordered list English German if i select 2nd item then it should shown at the top of the list...
1 Jul 2012 by mails4balaji
Hi,I am trying to assign a value to a model of specific index inside a list of models. However it assigns to all elements irrespective of index. tried even removeat and insert too, nothing seem to work. code snippet as below.BasketDetailsModel basketDetailsModel =...
17 Jan 2013 by Abhinav S
IF you are using windows forms, these links will help you out - http://msdn.microsoft.com/en-us/library/aa983754%28v=vs.71%29.aspx[^]http://msdn.microsoft.com/en-us/library/z4ka5fex.aspx[^]ASP.Net try - Show Image in Listview retrieve from database in ASP.net[^]
5 Apr 2013 by rexamkaruaz
Hello people all welcome. I hav started my career in windows programming.I am doing an project in SDI. I have two functions name sendtext(CString str) and displaytext(CString inr) both in different class.I have a pointer name pView to send the string str to function "displaytext".The...
5 Apr 2013 by nv3
It is probably the InsertColumn call that is spoiling your game. At the second call of displaytext you insert a new column, thereby shifting the existing column to the right and out of view. That is why you don't see the first value any longer.Place that InsertColumn call in your dialog...
10 Apr 2013 by vasantha kumar S
I want to have a image below a cursor when I drag and drop icons from a wxListctrl to a wxPanel.But when I try doing it i am not getting the image.Please help me out.Thank you.wxImageList* n1=ListCtrl1->GetImageList(wxIMAGE_LIST_SMALL);wxBitmapDataObject...
29 Apr 2013 by P Uday kishore
we are using virtual list control to display a list of data where am unable to use the LVSCW_AUTOSIZE option and LVSCW_AUTOSIZE_USEHEADER option.do we have any other way to auto size the columns of that controls...
29 Apr 2013 by Richard MacCutchan
Maybe you need to call AutoResizeColumns[^].
30 Apr 2013 by P Uday kishore
i am working on on to save the column width of a list control,but in my list control we used as virtual list control so am not able to update the column width.can we have any other option to increase or decrease the column width of virtual list control.
9 Jul 2013 by Hanoi 2014
hi all,I have a mfc listcontrol and when I'm typing Arabic words it display true. but when i want to use it as a parameter for a function it give me '????'. i do something that read in some page but it does not workplz help me
12 Jul 2013 by thanh_bkhn
Dear all,I need to load multiple images and display them into one column of a List control. I searched around and found many examples about display images into List control, they can do many awesome things, but they only display one image per column.Can you show me how to display multiple...
14 Jul 2013 by KarstenK
Here is a suberb article of the famous Michael Dunn about drawing in a list controlNeat Stuff to Do in List Controls Using Custom Draw[^]You need to user owner draw your stuff for yourself. I have shown you the way ;-)
22 Aug 2013 by vivek nuna
I have created one list control box in MFC. I have clicked on Row and that Row is selected.Now If I click anywhere outside of this list control box on that dialogue, that Row should be deselected. I have gone through but not able to find any help or solution, please help me out, As I am new to...
1 Sep 2014 by Menci Lucio
This is a control that lets you select an item from a list with a single gesture
23 Jun 2015 by Member 11770025
Hello there. I have a class with bind list here: class StafkiProperties { public string TarifenModel { set; get; } public string Artikl { set; get; } public string kolicina { set; get; } public string kolicinaMerka { set; get; } public int...
25 Jun 2015 by SteveHolle
I'm missing where dt is declared but it seems to me that you want to set the DataSource to a binding list? st.GetVerdnost() returns a binding list. Can you set the data source to st.GetVerdnost?
21 Nov 2015 by Igor-84
Hi!I need to perform custom drawing of the items according to this rules:1. Each first column of each item must perform owner drawing, e.g. use FillRect(), Rectangle() e.t.c.2. Each second column of each item must perform default windows drawing.3. And each third column of each item...
25 Nov 2015 by KarstenK
1. I didnt fizzle with this kind of Listview for some years, but I remember the first column (the item) is always handled separatly from the subitems. 2. somehow you can return that default drawing is done. I recommand for details the article and code Neat Stuff to Do in List Controls...
15 Dec 2015 by preetham lester
hi,am using XEdit box in a xlistctrl ,which enables the user to enter value for modification.i want to validate the value entered in the XEdit box to be only number .i used the pretranslate message function but its not working,at times it fails and alphabets and other characters are...
30 Mar 2016 by Member 12330615
In the show of the ListCtrl report style screen, I want to get the informations of any row which I click or double clicking.Someone advised me to use tictest of ListCtrl, I can see very rare examples about it.Directly speaking, When I clicked the screen of ListCtrl, I want to know the...
17 Apr 2016 by Member 12330615
In my MFC ugly code using CListCtrl report style:A::moveform(){ CListCtrl.insertitem(item); CListCtrl.SetItemText(stritem); UpdateData(FALSE);} A::Caller(){ for(int i = 0;i
22 Jun 2016 by Member 12330615
I use MFC VC++ to code a monitor program.It shows the data on the ListCtrl screen, the listctrl has 10 columns with report style.While the screen does not scroll, it is focused by one row directly.But while the screen does scroll, if I focus one row, the cursor cover more rows and...
22 Jun 2016 by Jochen Arndt
In your OnNMClickList2100 handler you are selecting an item (a row) when clicked on it. But this will not remove the selection from other actually selected rows so that you may have multiple selected rows.What is the purpose of handling that on your own? The default handling will select the...
27 Jul 2017 by Mark Danniel
I wrote a MFC application program.I used some ListControl controls and some radio buttons in the dialog.I would like to realize real-time-update data with ListControl when clicked the single radiobutton triggering the corresponding events. Firstly,when the dialog initialized,inserting data...
27 Jul 2017 by Jochen Arndt
The simplest solution is disabling drawing when the list is updated. m_ListCtrl.SetRedraw(0); // Update list here m_ListCtrl.SetRedraw(1); // Invalidate entire control // May also use InvalidateRect() for a specific area m_ListCtrl.Invalidate(); // Force redrawing m_ListCtrl.UpdateWindow(); ...
21 Sep 2017 by Mwater07
I would like to write a program that stores nonzero elements of 2 different vectors into 2 different linked lists with their indexes. Then would like t to calculate the dot product and displays the result. I am struggling to read in vector values with indexes into a link list. Please advice ...
21 Sep 2017 by Patrice T
The code is not complete, you should use the debugger to see what your code us doing There is a tool that allow you to see what your code is doing, its name is debugger. It is also a great learning tool because it show you reality and you can see which expectation match reality. When you don't...
9 Jul 2018 by User 8406082
Issue: The `VisualListViewItem` text draws in the first `VisualListViewSubItem` text position also when using the designer. ---------- Image: [Design](https://i.stack.imgur.com/st9z1.jpg) [Debug](https://i.stack.imgur.com/gBHka.jpg) ---------- Steps to reproduce: 1. Add `VisuaListViewEx`...
31 Jul 2018 by saide_a
I want to get row and column of list control where I click when I clicked, I use the following code, isubitem value is okey , but iItem value is 0 when I click on first column and -1 when I click other columns , how Can I get other colomns value and what is wrong in my code? Waiting for you. ...
19 Nov 2018 by Member 13621621
So I'm still getting use to VB.NET as I haven't had much time to play with it, and haven't done alot of coding since back in the vb6 days. Anyways, I'm working on a small personal project for me and my business partner to handle certain customer information. Basically it just has a few text...
19 Nov 2018 by Richard MacCutchan
You can use the String.Split Method (System) | Microsoft Docs[^] to separate the three parts. You may need an initial check to see which control characters are being used.
8 Sep 2020 by Member 14923361
I want to zip 4 lists, i manage to do it with 3 of them, but if there is more? How? What I have tried: IEnumerable> CollapedList = list1 .Zip(list2, (e1, e2) => new { e1, e2 }) ...
7 Apr 2021 by Daniel Peqini
I have created a click event for 4 buttons click, where if a button is clicked it is added to a list called buttonslist. Now all I need to do is to check if the button with the highest index out of 4 backcolor is red or blue. (program - visual...
7 Apr 2021 by Richard MacCutchan
How about implementing some of the suggestions you have already been given at How can I sort my buttons in an array in order they are clicked in visual basic?[^].
4 Dec 2022 by ernteSKY
I load all of data from the database into a List then display all in a ListBox. games_listBox.DataSource = _games; All games have a data: year of publication, year of manufacture, name, manufacturer, category. The question: How to display...
4 Dec 2022 by Richard MacCutchan
Take a look at A Detailed Data Binding Tutorial[^] which shows a number of ways to do it.
13 Dec 2022 by Rama Aljelani
I want to write shorter condition than this y = (website[-4:]!=".com" and website[-4:]!=".net" and website[-4:]!=".org" and website[-4:]!=".gov" and website[-4:]!=".edu") What I have tried: website = str(input("Enter your URL: "))...
17 Mar 2024 by Sh.H.
Hi folks. I have an Observation Collection. I used event CollectionChanged. But this event only raises when new item added, or an item deleted. So how can I detect if an item edited? (And ofcourse, it would better also to detect which item got...
19 Mar 2024 by Graeme_Grant
I am not sure what you are trying to do however I'll show you how to handle each item in the ObservableCollection. The Item class needs to implement the INotifyPropertyChanged Interface (System.ComponentModel)[^]. Microsoft provide a sample: How...
16 Mar 2015 by Rolf Kristensen
A custom draw CListCtrl with subitem editing and formatting
7 Feb 2013 by Faraz Azhar, Dubai
Building a list control that allows anything to be added to it.
11 May 2014 by KK Kod
Using JqGrid in MVC Applications
13 Feb 2011 by Vince Valenti
An example of how to add a checkbox to a list view column header. We also implement select/unselect all when a user toggles the checkbox.
12 Feb 2011 by Niklas L
Maybe the Rollup Control[^] could give you some ideas.
20 Jan 2013 by shizhanbiao
listcontrol proerties styles view Report Now I want to know, can in each insert a line of data later, behind shows a small icon.The question nagged me for days, are not implemented.Ask ace to help me look, how should do.
14 Apr 2016 by Member 12330615
1. I want to make a scrolling listctrl, so do not use next-screen button or previous-screen button.2. In the listctrl screen, for example: - If there are 10 rows to display - In the program, I move the values to the listCtrl variables (insertItem, setItemText) - After moving the...
17 Jan 2013 by shizhanbiao
how use listcontrol.setitem set a icon .help me !thank you .
6 May 2014 by Alif Marz
Hi,I have a List. Inside it I have a collection of string texts.I would like to manipulate the list into delete all the text except the text that have been typed into the textbox.How do I do that?Help needed. Thanks in advance. List final = new List(); ...
8 Oct 2015 by Member 12043947
string data = DataTextBox.Text; List gradeString = new List (data.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries)); List intList = gradeString.ConvertAll(Convert.ToInt32); intList.Sort(); string[]...
30 Mar 2016 by Jochen Arndt
Handle the NM_CLICK (list view) notification code (Windows)[^] and NM_DBLCLK (list view) notification code (Windows)[^] notification messages in your parent window. The LPARAM parameter for these messages is a pointer to a NMITEMACTIVATE structure (Windows)[^] containing all necessary...
7 Dec 2018 by BeardedPC
I'm making a mastermind game (the one where you gotta guess the password and it tells you how many of the codes you got right when you tried). BUUUUUT, I'm doing mine with a single word, and not multiple words or colors example: answer = "this" given = "that" print(str(answer - given) + "/4...