We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Custom Designer

Thread ID:

Created:

Updated:

Platform:

Replies:

2562 Jan 30,2003 05:20 PM Feb 19,2003 06:28 AM Windows Forms 2
loading
Tags: FAQ
Iulian Ionescu
Asked On January 30, 2003 05:20 PM

Hello, I have the following problem: I created an inherited class that inherits DataGrid and I added a property called MyProperty as integer. Then I created another class called CustomDesigner that inherits from System.Windows.Forms.Design.ControlDesigner and I setup the Design Attribute for my grid class to use this custom designer. All works ok (I can see some messages I inserted in the Initialize() function in the designer)... but... I fail to understand how to make the actual "connection" between the changes in the property and the code behind the form. For example, if I change the property "AllowDrop" from the default value of false to True, if I look in the code, right away the line: Me.TestGrid1.AllowDrop = True appears in the InitializeComponent() routine.... But, when I change the additional property (MyProperty) nothing changes in the code behind the form, therefore rendering my custom designer to a useless item... So, my question is: how can I "catch" the changes in the properties that extend a base class and reflect them in the InitializeComponent() function from the code behind the form? Any help is appreciated, Thank you! :thumb: Iulian PS: If you know any books that talk about custom designers...

ruud krank
Replied On February 18, 2003 06:39 AM

Please see www.bluevisionsoftware.com, 'books' section > Hello, I have the following problem: I created an inherited class that inherits DataGrid and I added a property called MyProperty as integer. Then I created another class called CustomDesigner that inherits from System.Windows.Forms.Design.ControlDesigner and I setup the Design Attribute for my grid class to use this custom designer. > All works ok (I can see some messages I inserted in the Initialize() function in the designer)... but... I fail to understand how to make the actual "connection" between the changes in the property and the code behind the form. For example, if I change the property "AllowDrop" from the default value of false to True, if I look in the code, right away the line: Me.TestGrid1.AllowDrop = True appears in the InitializeComponent() routine.... > > But, when I change the additional property (MyProperty) nothing changes in the code behind the form, therefore rendering my custom designer to a useless item... > > So, my question is: how can I "catch" the changes in the properties that extend a base class and reflect them in the InitializeComponent() function from the code behind the form? > > Any help is appreciated, > > Thank you! :thumb: > Iulian > > PS: If you know any books that talk about custom designers... >

Ramesh Praveen [Syncfusion]
Replied On February 19, 2003 06:28 AM

Iulian, If all you need is for the custom property's value to appear in the InitializeComponent block, then you don't even need a custom designer. Make sure that the control's type and the instance are both your derived type. Otherwise it beats me as to why your custom property's non-default value won't appear in code! -Praveen

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;