RE: One small way Visual Studio could prevent me from doing something
- From: v-lliu@xxxxxxxxxxxxxxxxxxxx (Linda Liu[MSFT])
- Date: Thu, 26 Jun 2008 01:40:11 GMT
Hi Michael,
Thank you for sharing with us how you solved the problem! And it's
interesting to read it : )
Because the constructor of the derived RichTextBox class in your custom
control library was not public, the form designer could not serialize the
code that instantiate the derived RichTexBox control in the
InitializeComponent method of the form when you dragged the custom control
from Toolbox and dropped it onto a form.
When you opened the form again in the designer, the form designer executed
the code in the InitializeComponent method of the form and found that the
"myRichTextBox1" is not instantiate and then throw an exception.
What would have saved me a lot of effort was if--at the moment I draggedthe
control onto my form--Visual Studio said, "Wait a minute! I cannot
instantiate this control due to its protection level."
Yes, it is. Unfortunately, when we add controls onto a form, what the form
designer does is to serialize code that instantiate and initialize the
controls added onto the form in the InitializeComponent method. Only when
we open the form again, the form designer will execute the code in the
InitializeComponent method and then find the exception.
Anyway, thank you for sharing with us your experience again and I think it
would benefit all of us.
Sincerely,
Linda Liu
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- References:
- One small way Visual Studio could prevent me from doing something
- From: michael sorens
- One small way Visual Studio could prevent me from doing something
- Prev by Date: One small way Visual Studio could prevent me from doing something
- Next by Date: Comment Outline Blocks
- Previous by thread: One small way Visual Studio could prevent me from doing something
- Next by thread: Comment Outline Blocks
- Index(es):
Relevant Pages
|