473,383 Members | 1,742 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,383 software developers and data experts.

inherite windows forms user control

Hi,

Can someone give me a hlep on inherited user control?

I try to inherite windows forms user control, like ListView.

From Visual studio 2003, I right click a folder and selct "Add inherited
user control ...", then I browser to

c:\winnt\microsoft.net\framework\v1.1.4322\system. windows.forms.dll

But I don't see windows forms control(e.g. ListView) in the list.
Then I just create a class MyListView and inherite ListView, and try to put
it on a form, then Press F4 to edit its properties, it gives me an
System.StackOveeflowException. What cause this to happen?

What is right way to develop a inherited user control, like my own ListView?

Thanks a lot!
Ryan
Dec 16 '05 #1
2 1817
Dear ryan ,
Following is the way to Inhert a control

public class MyForm: Form
{
.....// ur implementation
}

public class MyListView : ListView
{
...//// ur code
}

Regards,
Naveed Ahmad Bajwa
http://bajoo.blogspot.com/

Dec 16 '05 #2
Thanks Najoo!

And I also find the System.StackOveeflowException is because of my silly
mistake:

The public property name is same as private attribute name, so it trigger an
endless loop.

And see MyListView as a control on toolboxes, I just added a class, then
later I change
MyListView: UserControl to MyListView:ListView.

This trick works fine for me.

All the Best,
Ryan

"Bajoo" <Na**********@gmail.com> ????
news:11*********************@g14g2000cwa.googlegro ups.com...
Dear ryan ,
Following is the way to Inhert a control

public class MyForm: Form
{
....// ur implementation
}

public class MyListView : ListView
{
..//// ur code
}

Regards,
Naveed Ahmad Bajwa
http://bajoo.blogspot.com/

Dec 16 '05 #3

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

Similar topics

2
by: Greg Bacchus | last post by:
Hi, I'm getting an exception that really has me stumped. It's sporadic at best, it's only happened a handful of times. This particular time it happened when the user pressed 'Alt-S' to save the...
0
by: Tim Haughton | last post by:
I've just released an article on using Test Driven Development with C# and Windows Forms. GUI's are often difficult to test, so I thought it might be of interest. The article along with the...
0
by: Sinisa | last post by:
I have a Windows form which has multiple groups of the same window controls. I wanted to create a control class that has the standard controls in one. something like: public class Sensor :...
5
by: Dave | last post by:
How do I check in a Windows Forms app if any controls have changed? I have a form that collects data, and I want to prompt the user if they try to exit the app, or load a new file, without saving...
5
by: pberna | last post by:
Dear all, I built a Web Form application to start and stop a Windows Service remotely. I successful tested the application on Windows 2000 server + IIS. I must include the ASPNET user to the...
5
by: John Smith | last post by:
Hi folks, I'm embedding a Windows Forms User Control into an aspx web page. I've created the class library in C# and added the user control to it. If the control just has simple Windows Forms...
7
by: Tyler Foreman | last post by:
Hello, I have a strange problem that occurs every so often in my application. It usually takes place when I hide one form and activate another. What happens is I get the following exception:...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
21
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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...

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.