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

user control constructor with parameters

Shashi Sadasivan
1,435 Expert 1GB
Hi,
I converted some of my form functions as a user control, and it has to work based on a tables specified row (which ispassed to it using the parameter in the constructor)
So i make the constructor with the parameter, and delete the default constructor (ie the constructor with no parameters)
Now if i drag this control onto the form, it throws all sorts of errors, but mainly due to the reason that it did not find the default constructor.

My work around it is to uncomment the default constructor, drag it onto my form , then comment the default constructor and make the necessary changes.

is there a simpler way that you might be aware of?

Thanks
Sep 5 '07 #1
0 1136

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Z D | last post by:
Hello, I've created a winform user control that, at some point in the default constructor, looks for a specifc file. When I try to load the user control to my winform's form during design time...
0
by: Ryan Liu | last post by:
I have a user control, it must set a property when it is just created, so I set it in its constructor, which has an parameter to specify the property . For example: public class ExecQuest :...
1
by: Landley | last post by:
Hi Everyone, I have created a user control that contains two buttons. The buttons have been created using <asp:Button> tag. I have then created another user control that contains an...
3
by: Paul McKenna | last post by:
Hello I have a custom user control which I have developed. This user control needs to have one property value passed to it from the parent form. I tried using the constructor to do this, the...
0
by: tsmith | last post by:
Hi Can somebody help me, please! I'm trying to use a third-party .NET forms control in an unmanaged COM-aware application (MFC). I have no problem doing this with normal .net controls, as...
4
by: Can-Ann | last post by:
Using VS 2005 c#: I have a main form and a user control: I want to pass some variables from the main form to the user control. Can anyone show me how this is done. Thanks in advance.
3
by: Alejandro González | last post by:
Hi. I have this problem. I create a user control with a constructor with several parameters. I also add the default constructor so I can add this control in desing time to a form. Why this...
1
by: Nathan Sokalski | last post by:
I have created a custom control for ASP.NET using VB.NET. My control inherits from the System.Web.UI.WebControls.CompositeControl class, and is working fine. However, the Visual Studio .NET designer...
6
by: alun65 | last post by:
I'm having trouble programmatically adding a user control and then setting some of it's server controls. I add the user control to the code behind and add it to a placeholder: protected void...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.