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 / Languages / Managed C++ / June 2007

Tip: Looking for answers? Try searching our database.

CLI/C++ DesignerAttribute quesion

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cjs - 03 Jun 2007 04:24 GMT
Hi,

I'm using CLI/C++ to develop a custom control in VC2005 IDE for fun. I wrote
a designer class inheriting from ControlDesigner. I overrode Initialize
method to set up initial control properties like:
void MyDesigner::Initialize(IComponent^ component)
{
 this->component = component;
 Plate^ plate = safe_cast<Plate^>(component);
 Plate->PanSize = Size(140, 140);

 ControlDesigner::Initialize(component);
}

I also overrode SelectionRules property to make the control not resizable on
the designing form.
     virtual property System::Windows::Forms::Design::SelectionRules
SelectionRules
     {
         System::Windows::Forms::Design::SelectionRules get () override
       {
         return
           System::Windows::Forms::Design::SelectionRules::Visible |
           System::Windows::Forms::Design::SelectionRules::Moveable;
       }
     };

I then added the designer attribute to my plate class:
   [Designer("PlateDesigner", "ControlDesigner")]
   public ref class Plate : public Control

I compiled/linked the code allright. However, when I drag and drop it from
general Toolbox of IDE onto the form, the control doesn't have the initial
size as I set up (i.e. 140x140), and also the resizing little resizing boxes
still appear. I'm new to such designable custom control. Could anyone tell me
what right way to control initial value and designtime behaviour when a
designable custom control is dropped from toolbox?

Thanks
Ben Voigt [C++ MVP] - 04 Jun 2007 14:21 GMT
> Hi,
>
[quoted text clipped - 37 lines]
> what right way to control initial value and designtime behaviour when a
> designable custom control is dropped from toolbox?

This question is about .NET design time behavior in general, not C++/CLI in
particular.  You will probably have better luck posting in
microsoft.public.dotnet.framework.windowsforms.designtime because someone
using a different .NET language may still be familiar with your problem.

> Thanks

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.