473,405 Members | 2,310 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,405 software developers and data experts.

User Controls - C#

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 3572

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

Similar topics

1
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...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
4
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
2
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
0
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
3
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
1
by: Demetri | last post by:
I'm trying to determine if we want to use panels or user controls for our pages. Our primary concern is performance, page loading and posting speed. To illustrate my question, lets use the...
8
by: mark.norgate | last post by:
I've run into a few problems trying to use generics for user controls (classes derived from UserControl). I'm using the Web Application model rather than the Web Site model. The first problem...
3
by: Terry Olsen | last post by:
I'm trying to add a domain user to a local group using the code below: Dim LCL As New DirectoryEntry("WinNT://" + Environment.MachineName + ",computer") Dim DOM As New...
1
by: zeya_bakhtyar | last post by:
Here is the page architecture: Page loads multiple user controls (including nested user controls) dynamically based on parameters provided into place holders. Note: The page only has the logic to...
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
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
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...
0
agi2029
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,...
0
isladogs
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...

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.