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 / October 2008

Tip: Looking for answers? Try searching our database.

designers typeof(IRootDesigner)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Krzysztof Gorniak - 13 Jul 2006 22:35 GMT
hi there,

I'm looking for good tutorial on making iroot designer.

I need a custom designer just like this one
http://windowsforms.net/articles/shapedesigner.aspxbut i want the shape to
be a containerfor onthers windows forms controls. Is it possible ?Are there
any good books or other knowledge sources where i can learn about developing
custom iroot designers ? thanks in advance,Krzysztof Gorniak
Linda Liu [MSFT] - 14 Jul 2006 12:56 GMT
Hi Kris,

Thank you for posting.

This is a quick note to let you know I am researching on this issue and
will get back to you as soon as possible. I appreciate your patience.

Sincerely,
Linda Liu
Microsoft Online Community Support

============================================================================
=============================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.

============================================================================
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Linda Liu [MSFT] - 17 Jul 2006 11:35 GMT
Hi Kris,

I don't think it is possible to put Windows Form controls onto the shape.
The reason  is that the Shapes property of the ShapeContainer class is of
type ShapeCollection  which can only contains objects of type Shape.

You may refer to the following link to learn about developing custom
IRootDesigner.

http://msdn2.microsoft.com/en-us/library/system.componentmodel.design.irootd
esigner(d=ide).aspx

Hope this helps.
If you have anything unclear, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

============================================================================
=============================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.

============================================================================
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Roman - 17 Jul 2006 16:28 GMT
   Hi Kris
   Have you tried to inherit from
System.Windows.Forms.Design.DocumentDesigner? It implements iroot designer
interface and can contain controls. And the most pleasant thing: it contains
virtual methods (there are a lot of sealed and internal members and classes
in VS DT. I hate them) so you can override it's behaviour to your needs :).
Signature

Thanks Roman
--

> hi there,
>
[quoted text clipped - 5 lines]
> there any good books or other knowledge sources where i can learn about
> developing custom iroot designers ? thanks in advance,Krzysztof Gorniak
Krzysztof Gorniak - 18 Jul 2006 21:01 GMT
Hello there,

first of all - thanks for interesting.

System.Windows.Forms.Design.DocumentDesigner has all i need ...
but  when i use it with UserControl for example there is always
a  border of control and small padding on the top and left which i mustn't
have.

When i try to go "one step higher" and derrive from ScrolableControl
designer
i can't drop windows forms controls on my control.

So at the time i'm stuck.

I would appreciate any help.

regards,

Krzysztof Gorniak

>    Hi Kris
>    Have you tried to inherit from
[quoted text clipped - 12 lines]
>> there any good books or other knowledge sources where i can learn about
>> developing custom iroot designers ? thanks in advance,Krzysztof Gorniak
Linda Liu [MSFT] - 21 Jul 2006 14:23 GMT
Hi Kris,

Thank you for your response.

My answers to your two questions are listed below.

1.  About DocumentDesigner

I performed a test on the DocumentDesigner. I set up a Windows project, in
which I derive a class called MyDesigner from DocumentDesigner class.  
Below is the code of the MyDesigner class.

using System.Windows.Forms.Design;
using System.ComponentModel.Design;
using System.Windows.Forms;

public class MyDesigner : DocumentDesigner
   {
       public override DesignerVerbCollection Verbs
       {
           get
           {
                // add a verb to the designer to distinguish between the
default form designer
               DesignerVerbCollection c = base.Verbs;
               c.Add(new DesignerVerb("MYVERB", new EventHandler(EH)));
               return c;
           }
       }

       private void EH(object sender, EventArgs e)
       {
           MessageBox.Show("MY VERB!");
       }
   }

Then I add a UserControl named UserControl1 in the project  and add
DesignerAttribute[typeof(MyDesigner),typeof(IRootDesigner)] to the
UserControl1 class. The statements are shown below.

using System.ComponentModel.Design;

[Designer(typeof(MyDesigner), typeof(IRootDesigner))]
   public partial class UserControl1 : UserControl
   {
       public UserControl1()
       {
           InitializeComponent();
       }
   }

When I open the UserControl1 in designer and right click on it, the verb
"MYVERB" won't appear in the context menu. This is because the UserControl1
is displayed by VS with the default designer. The new designer--MyDesigner
only takes effect on the class derived from the UserControl1.

I didn't see the problem that " there is always a  border of control and
small padding on the top and left ". Would you tell me what you mean by
that?

2. About ScrollableControlDesigner

ScrollableControlDesiger should be only used with srcollable control, such
as Panel. But it doesn't provide a root-level design mode view. So
ScrollableControlDesigner couldn't be associated with a form or user
control.

I have performed a test but I didn't reproduce the problem you described.  
Below is the steps of my test.

a. Inherite a new class from ScrollableDesigner. The code of the new class
is like below.

using System.Windows.Forms.Design;
using System.ComponentModel.Design;
using System.Windows.Forms;

class MyScollableControlDesigner:ScrollableControlDesigner
   {
       public override DesignerVerbCollection Verbs
       {
           get
           {
               DesignerVerbCollection c = base.Verbs;
               c.Add(new DesignerVerb("MYVERB", new EventHandler(EH)));
               return c;
           }
       }

       private void EH(object sender, EventArgs e)
       {
           MessageBox.Show("MY VERB in scrollable component!");
       }
   }

b. Inherite a new class named MyPanel from Panel and associate the new
designer with MyPanel.The code of the new class is like below.

using System.Windows.Forms;
using System.ComponentModel;

[DesignerAttribute(typeof(MyScollableControlDesigner))]
   public class MyPanel:Panel
   {    }

c. Build the project and  drag&drop a MyPanel from toolbox onto a form.
d. Drag&drop a common control onto the MyPanel on the form in the designer.

Hope this helps.
If you have anything unclear or any questions, please feel free to let me
know.

Sincerely,
Linda Liu
Microsoft Online Community Support
campa - 20 Oct 2008 08:39 GMT
Hi, i was looking for something like that, i got the same problem.
I think its a standard attitude of windows controls, i don't know why and i
find no way to manage that.
You can see an example on
http://windowsclient.net/articles/shapedesigner.aspx
In the shape at step 3. The TestForm isnt at location 0, 0 theres a padding
and i'm not able to remove it.
If you built a custom user control as a designer and you override
OnLocationChanged you can see the control location and its something like 13,
13.

Also i would like to add vertical and horizontal rulers, but i can't find the
way out to do that.
Any hints?

Cya.

>Hi Kris,
>
>I didn't see the problem that " there is always a  border of control and
>small padding on the top and left ". Would you tell me what you mean by
>that?
Linda Liu [MSFT] - 25 Jul 2006 12:31 GMT
Hi Kris,

I am closely monitoring the newsgroup and I am contacting you to check the
issue status.

If the problem is not resolved or you have anything unclear, please feel
free to post in the newsgroup and we will follow up.

Thank you for using our MSDN Managed Newsgroup Support Service!

Sincerely,
Linda Liu
Microsoft Online Community Support

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.