473,387 Members | 1,453 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.

Designer problem / User Control issue

Jim
I am having some trouble with user controls and would appreciate any input /
advice on where to go with this... :)

1. The first problem, and perhaps the root of the others, is that I have
several user controls that are inherited user controls, based on one class,
which is in turn based on System.Windows.Forms.UserControl. We'll call this
class "UserControlBase". My first problem is that UserControlBase implements
some public properties that really have no meaning at design-time. ie, their
values are based on object references that are not set at design time. When
the designer tries to render the values of these properties in the design
grid, you get an "Object Reference Not Set to an instance of an object"
error. I resolved this problem by providing the following attribute to all
of my properities of UserControlBase...

[DesignerSerializationVisibility( DesignerSerializationVisibility.Hidden)]

This keeps the designer from showing the properites in the grid. However,
when I then compile, and create a new user control based on UserControlBase
(let's call it InerheritiedUserControl), it is once again trying to obtain
values from the public properties that it inherited from UserControlBase,
thus ignoring the attribute I put on there. Is there anything I can do to
keep the designer from attempting to display or otherwise auto-generate code
for my properties of a user control?

2. Problem #2 I am going to guess is probably related to problem #1, in
that it's probably being caused by the fact that something in the deisgner is
puking over my user controls, and this screws up the rest of the environment,
as this is the first time I've ever seen this happen... Any thoughts? The
problem is that when I switch from code view to design view for one of my
inherited user controls, or any other control that has one of these inherited
user controls hosted on it, and then switch back to code view, the IDE starts
misbehaving. ie, all the blue keywords (if, else, public, etc) turn black;
the Intellisense quits working, and stuff doesn't auto-indent properly when I
type. The only way to fix it is to close and re-open the environment. This
only seems to become an issue when you do something inside the visual design
environment and then try to go back out to code. I have never run into this
before, which is why I'm guessing that it's related to the other problem I
described above.

Thanks in advance for any input on this....
Nov 16 '05 #1
0 1870

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

Similar topics

7
by: Martin Schulze | last post by:
Hello, i tried to compose myself a custom usercontrol which is derieved from System.Windows.Forms.UserControl. It contains 2 comboboxes and one textbox (which are also custom controls, but...
5
by: Markus Wildgruber | last post by:
Hi! We create an inherited user control and add it to a form. When we successfully compile the project and switch to the designer of the form again, the control disappears and we get 2 error...
0
by: George Economos | last post by:
I apologize in advance for this post since I have seen it many times before, but never a adequate solution. Here is my situation: (1) Created an assembly that contains the following class: class...
19
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and...
11
by: PAul Maskens | last post by:
The form designer adds unnecessary code to the section when using a subclassed control. I've reproduced this in VS.NET 2002 and VS.NET 2003 so it's pretty fundamental. Outline steps: Create a...
1
by: Lucien Dol | last post by:
Hi all, Can someone help me with this, please? I've got a user control that (amongst other controls) contains a textbox. The textbox has its Anchor property set to "Left, Top, Right", meaning...
1
by: Lucien Dol | last post by:
Hi all, Can someone help me with this, please? I've got a user control that (amongst other controls) contains a textbox. The textbox has its Anchor property set to "Left, Top, Right", meaning...
2
by: Max2006 | last post by:
Hi, I have a user control with a public property like this: public string Text { get { return cboCountry.Text; } set { cboCountry.Text = value; } }
4
by: Goran Djuranovic | last post by:
Hi all, I am experiencing a strange thing happening with a "designer.vb" page. Controls I manually declare in this page are automatically deleted after I drop another control on a ".aspx" page. -...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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,...

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.