473,796 Members | 2,573 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

About User Controls

Raj
Hi,

I have created a Windows 'user control' in C#.NET. This user control defines
several public 'properties' that the outer world can use to tweak the
behavior of the user control. However, whenver I drag the user control to a
Form, I noticed that the 'Windows Form Designer generated code' contains
several auto generated statments to initialize the 'properties' that are not
proper. This causes the Form designer to get corrupt and shows a designer
error in design mode. This happens each time I build the code!!!

The property that is defined is
public object[] UserControlData
{ set { } get { } }

and it is getting assigned the foll value due to which it is getting
corrupted:
this.expertTime line1.UserContr olData = new object[0] { new System.Double[]
{ 1E+108}, new System.Double[] {1E+108}};

Is there someway to prevent the auto generation of code?
Is there some way to define default values for the properties?
Is there something wrong in the way I am defining the methods?
Thanks & Regards,
Raj

Nov 17 '05 #1
1 2352
Just one post is enough man!

I answered this over in the controls group.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Raj" <ra************ *@networkgenera l.com> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Hi,

I have created a Windows 'user control' in C#.NET. This user control
defines
several public 'properties' that the outer world can use to tweak the
behavior of the user control. However, whenver I drag the user control to
a
Form, I noticed that the 'Windows Form Designer generated code' contains
several auto generated statments to initialize the 'properties' that are
not
proper. This causes the Form designer to get corrupt and shows a designer
error in design mode. This happens each time I build the code!!!

The property that is defined is
public object[] UserControlData
{ set { } get { } }

and it is getting assigned the foll value due to which it is getting
corrupted:
this.expertTime line1.UserContr olData = new object[0] { new
System.Double[]
{ 1E+108}, new System.Double[] {1E+108}};

Is there someway to prevent the auto generation of code?
Is there some way to define default values for the properties?
Is there something wrong in the way I am defining the methods?
Thanks & Regards,
Raj

Nov 17 '05 #2

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

Similar topics

1
2137
by: William Ryan | last post by:
Well, that depends. http://www.amazon.com/exec/obidos/tg/detail/- /0672320681/qid=1056861878/sr=1-1/ref=sr_1_1/002-7953039- 7491213?v=glance&s=books Is a must read IMHO for any ASP.NET developer. www.dotnetjunkies.com and their book http://www.amazon.com/exec/obidos/tg/detail/- /0672321068/ref=lib_dp_TFCV/002-7953039-7491213? v=glance&s=books&vi=reader#reader-link is another great resource.
1
251
by: William Ryan | last post by:
Well, that depends. http://www.amazon.com/exec/obidos/tg/detail/- /0672320681/qid=1056861878/sr=1-1/ref=sr_1_1/002-7953039- 7491213?v=glance&s=books Is a must read IMHO for any ASP.NET developer. www.dotnetjunkies.com and their book http://www.amazon.com/exec/obidos/tg/detail/- /0672321068/ref=lib_dp_TFCV/002-7953039-7491213? v=glance&s=books&vi=reader#reader-link is another great resource.
0
1492
by: Jason | last post by:
I am pretty new to C# so bare with me... The design of my website utilizes tables on every page that look almost identical, save the data they are displaying. I have written the code to create the body of these tables using a DataGrid, so I can dynamically add rows to the table without modifying the HTML. Now, I want to put this DataGrid into a user control that I can include in the HTML code, then control the behavior of that DataGrid...
4
292
by: Jason | last post by:
I am pretty new to C# so bare with me... The design of my website utilizes tables on every page that look almost identical, save the data they are displaying. I have written the code to create the body of these tables using a DataGrid, so I can dynamically add rows to the table without modifying the HTML. Now, I want to put this DataGrid into a user control that I can include in the HTML code, then control the behavior of that DataGrid...
1
2140
by: Robert Howells | last post by:
Perhaps I'm just too new at this to pull it off, or perhaps it's just bad architecture. I'd appreciate some feedback on the the wisdom (or lack thereof) in attempting the following: I'm not new to programming, but I am new to ASP.NET and Web application design in general... loved the concept of user controls and dynamically adding them to a page. So what I wound up with was an application that dynamically loads two user controls directly...
0
9684
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9530
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10236
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10182
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10017
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6793
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.