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

User Control Constructor With Patameter

Hi all,

.NET 3.5, WinForm app, C#, Visual Studio 2008

I have created custom control comTextBox, I added it drag-drop to form. Done, compiled, run, all OK. Month ago I changed control constructor and I added to constructor parameter and I manualy changed all designer.cs files

Compiled, works fine, but components are not visible in design mode.

this is current constructor which works fine fails when Visual Studion loads design form:
Expand|Select|Wrap|Line Numbers
  1. public comTextBox (InSettings _InSettings)
  2. {
  3.     this.oInSettings = _InSettings;
  4. }
So, I changed constructor like this (yes I know that in InSettings constructor is large code which will slow application if I create NEW object in every comTextBox control, which is widely used)
Expand|Select|Wrap|Line Numbers
  1. public comTextBox ()
  2. {
  3.     this.oInSettings = new InSettings();
  4. }
  5.  
and what a surprise, I get another one error - somethink like object set:
Object reference not set to an instance of an object

So, how to correctly, for Visual Studio too, add a parameter to a constructor?
Mar 14 '08 #1
0 859

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

Similar topics

1
by: Jay Douglas | last post by:
I need help getting the collections to show up in the property window of a user control. I want to be able to edit the collection items just like any other asp.net control that has collection...
2
by: Technical Group | last post by:
Friends, Can anybody help me out by sending a piece of C# code showing how to add an active directory user to a particular user group? If the group does not exist, then create it. Thanks in...
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 :...
6
by: Jason Winters | last post by:
I have implemented a user control in c# .net 2002 but the problem is that the control keeps disappearing off of the form for no reason. I am not making any changing to the form or the control. It...
0
by: tony | last post by:
Hello! This is a rather long mail but it's a very interesting one. I hope you read it. I have tried several times to get an answer to this mail but I have not get any answer saying something...
11
by: Rimpinths | last post by:
I'm new at developing user controls in C#, and one thing I've noticed right off the bat is that the constructor gets called twice -- once at design time, once at run time. In short, I'm trying...
1
by: brixdotnet | last post by:
Hi there! I made own user control for displaying and editing content. In Page_Load of this control is checked if user is authorized for editing if so, button for editing is shown, otherwise...
4
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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
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.