PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Controls and Designer

Reply

Controls and Designer

 
Thread Tools Rate Thread
Old 03-03-2006, 09:45 PM   #1
=?Utf-8?B?U3RlYW1ib2F0?=
Guest
 
Posts: n/a
Default Controls and Designer


I have created my own GUI library by creating several custom controls from
scratch. There is an image button, flow layout panel, list box, combo box,
edit box and keypad. They are all created as individual projects (.dll's)
within one solution which has a test form.

The combo box that I created references the list box control. There is a
class contained within the list box project called ListItem. I added the
list box control as a reference within the combo box class.

Here's the problem:

If I drag and drop a combo box onto the form and deploy it, all works well.
If I close the Designer before I exit Visual Studio (2005), all is okay.
But, if I leave the Designer open, exit VS and then reopen VS, the form will
not reload and I get Designer errors, something about not being able to find
the list box control. If I close the screen containing the errors (i.e. the
Form), and reopen I get no errors.

As I mentioned, the list box control contains a class called ListItem. If I
add the following one line of code to the constructor, I get the Designer
error (no error if I don't): listItems = new ListItem[5]; If I define
ListItem locally in the Combo Box class, I don't get the error. It is only
when I reference the ListItem in the List Box control.

Obviously, there is something about how the Designer deals with controls
that reference other UserControls that I do not quite understand. I thought
that if you included the other controls within the References section in the
Solutions Explorer that there would be no problem.

One more thing worth mentioning. I do notice that when I bring up my VS
solution, that I briefly see messages saying that each control that I
mentioned in the beginning cannot be found. This only displays very briefly
and then clears out. I was wondering if perhaps the Designer tried to load
before the control libraries were found. The only problem that I have with
this interpretation is that once the Designer gets in the error mode, the
only way that I can get it to out is by closing the form (which now only
displays errors) and reopening VS. (Rebuilding does not work.) Moreover, I
have no problems with any other controls which reference other controls (e.g.
my edit box references the image button and the edit box references a keypad,
but no problems).

I apologize for being so verbose but I wanted to try and convey a thorough
picture. If anyone could help me with this I would appreciate it.
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off