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 1 2351
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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.
|
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.
|
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...
|
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...
|
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...
| |
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,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |