473,395 Members | 1,401 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.

How to call the Constructor with Parameter using IDesignerHost.CreateComponent

Hi,

As you know, In design-time of .net framework, all controls created
by IDesignerHost.CreateComponent. But my control's constructor has some
parameter, how to call it?

Jerry
Nov 16 '05 #1
1 2805
Hi Jerry

Maybe i'm wrong, but i think that you shold have "default"
constructor for every control/component that you want to place
from designer.
Visual studio doesn't allow you to place control without
default contructor.

To call parametrized constructor from "default" use:

public MyControl()
: this(param1, param2, ...)
{
// todo
}

Regards

Marcin
Hi,

As you know, In design-time of .net framework, all controls created
by IDesignerHost.CreateComponent. But my control's constructor has some
parameter, how to call it?

Jerry

Nov 16 '05 #2

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

Similar topics

6
by: tzach | last post by:
Call constructor on an already existing instance? I like to execute the constructor logic, including all the class member constructors, on an existing instance (with out executing the destructor)....
4
by: Alan Wang | last post by:
Hi there: I am just wondering if I could call java library using C#. The reason to do that is my application wants to automate OpenOffice and create document. Thanks in advance Alan
0
by: roberto | last post by:
I try to add a textbox from code of my custom component laid on the web form. It appears in the code behind but not in the designer; moreover when I switch from design to html view it gets removed...
4
by: Chad Miller | last post by:
I have a class with 50 properties sp01 .. sp50 is there a way to call a property using a string? ex. o.sp & "01" Chad
7
by: Geoffrey | last post by:
Hello, I wan't to have optionnal parameter in my cronstructor, so, I define 2 constructors. when I call the constructor without the "optional" parameter, I want to call the constructor...
9
by: Joseph Turian | last post by:
Consider this code snippet which doesn't compile: struct DebugOptions { }; class Debug { public: Debug(const DebugOptions options) { _options = options; } private:
3
by: mike.arsenault | last post by:
Hello I need some help from anyone that can provide it. Below is a function inside a template collection class that I'm writing. I have a TYPE * that points to an allocated memory location, and...
2
by: Griff | last post by:
Bizarre problem here.... I have a classic ASP web page that exists in one project. I have copied this code file into another web project and it errors! The code has not been altered in any...
9
by: Allen | last post by:
The arguments of function is variable. Given function address, argument type and data, how to dynamically call the function? The following is pseudo code. int count = 0; int offset = 0; char...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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,...
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.