Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / April 2008

Tip: Looking for answers? Try searching our database.

Composite Control Issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Patricio Vidal - 02 Apr 2008 01:03 GMT
Hello,

I have a composite user control that contains a ListView and a PictureBox
inside a SplitContainer When I drag this user control to another user
control I would like the user to be able to edit the ListView control.  How
do I do that?  I created a public property in the composite control to
expose the ListView object and added the Browsable attribute, but that
doesn't allow me to click on the ListView and edit it.

This functionality is available in the SplitContainer control because when I
click on one of the Panels it shows the property <SplitControlName>.Panel1
(or 2) and you can edit it, so that I assume it should be possible to do it
on my control.

Thank you in advance for your help.

Regards,
Patricio.
Linda Liu[MSFT] - 02 Apr 2008 06:03 GMT
Hi Patricio,

To enable your composite user control to support the same design-time
function as the SplitContainer, you need to author a custom designer for
the composite user control to extend the design-time environment.

In detail, you extend the appearance of your custom design UI by
implementing a Glyph class and extend the behavior by implementing a
Behavior class. The Bahavior class is subordinate to the Glyph class. You
attach a Behavior object to a Glyph object in your Glyph type's constructor.

You override the GetHitTest method in the Glyph class to return a Cursor
object when the mouse pointer is over your glyph's hot spot. When the
design environment receives a value from your GetHitTest method that is not
null, it activates the Behavior object associated with your Glyph.

You override Behavior class methods like OnMouseDown to paint the selection
rectangle around the nested ListView control and set the primary selection
to this ListView control.

For more information on how to extend the appearance and behavior of
controls in design mode, please refer to the following MSDN document:
http://msdn2.microsoft.com/en-us/library/ms171820.aspx

Hope this helps.
If you have any question, please feel free to let me know.

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@microsoft.com.

==================================================
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.