473,395 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

custom listview object

a
Hi

I would like to add some additional custom features to the listview, like
cell editing. The created object will be added to the form as part of the
GUI, and it should be able to handle events.

I will create a class which conains the listview. Should I inherit this
class from any existing class? If yes, which class should I inherit from?
Or, should I just inherit my class from listview and add my add my
additional features?

Thanks
Jul 13 '07 #1
1 2645
On Thu, 12 Jul 2007 17:37:42 -0700, a <a@no.comwrote:
I would like to add some additional custom features to the listview, like
cell editing. The created object will be added to the form as part of the
GUI, and it should be able to handle events.

I will create a class which conains the listview. Should I inherit this
class from any existing class? If yes, which class should I inherit from?
Or, should I just inherit my class from listview and add my add my
additional features?
I would think that inheriting from the ListView class itself is the best
approach. You could extend it by composition (which is the other approach
you're talking about, by containing the ListView class in a new class
rather than inheriting it), but then you will have to forward every single
method and property that you want to be able to use of the ListView
class. That's potentially a lot of work. If you inherit it, then all of
that is done automatically.

Inheriting also gives you better access to the internal stuff in
ListView. In particular, protected members that might be useful in your
extending it. And even more particularly: the WndProc method. I don't
know about the ListView class specifically, but all of the controls in the
Forms namespace that I've messed with are just wrappers around a native
Win32 control.

As such, most of the interesting stuff actually happens in the control's
window proc, rather than the .NET class methods. Overriding things like
MouseDown, MouseMove, MouseUp, KeyDown, KeyUp, etc. does not actually get
you full control to the control's behavior, the way that overriding
WM_LBUTTONDOWN, WM_MOUSEMOVE, etc. in the native Win32 environment would.
You still need to override those specific native Win32 window messages,
and that's done in the WndProc method.

Pete
Jul 13 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Simon Middlemiss | last post by:
I am writting a program to manage DTS packages which is based on the code example at the following link http:\\www.support.microsoft.com/?kbid=319985. I need to do things in a Windows Forms...
8
by: Tinus | last post by:
Hello all, I've create a custom control (UserControl) and have a custom Item Collection. The control is a custom calendar which is draw using the Graphics Rectangle etc. functions. It is drawn...
0
by: sorpor | last post by:
I am trying to create a custom listviewsorter by implementing IComparer. My listview has check boxes and the purpose is to move checked item to top of list. They all will be sorted ascendingly. It...
5
by: CJ Taylor | last post by:
Hey all, This is probably a dumb question, but still feeling a little strange from Labor day festiviities. Anyways, I want a shared sub, at least something that is easy to call from any one...
1
by: Jeff | last post by:
I've made a custom Listview control, and i want this control to use a custom ColumnHeader control that I've created. how can i do this thanks
5
by: ToddH | last post by:
I know the following code is C#. I'm a vb programmer trying to learn a new language. I posted this in the c# group but never got a response. You guys seem to know alot about all languages and have...
0
by: Piotr Strycharz | last post by:
Hi, I need to develop a custom control. The control is going to be something like Properties window in VS - listview (grid?) with resizable columns and collapsable sections. The control needs...
7
by: =?Utf-8?B?YnJhaW5mdWVsbWVkaWE=?= | last post by:
Can anyone point me in the direction of creating a custom listview item? I guess the other question then - is this possible? I want to create a list of listview items comprised each comprised of...
1
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
I'm running VS2008 & attempting to solve a problem I've encountered while developing some software for our business. Here's the basic idea...I've created a class that represents a file (with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.