all groups > dotnet windows forms designtime > may 2004 >
You're in the

dotnet windows forms designtime

group:

Setting designer for form


Re: Setting designer for form Stoitcho Goutsev (100) [C# MVP]
5/12/2004 4:35:56 PM
dotnet windows forms designtime: Hi Kent,

VS will use your designer when you design a form that inherits from Form1.
For Form1 it uses the normal Form designer.

--

Stoitcho Goutsev (100) [C# MVP]


[quoted text, click to view]

Setting designer for form Kent Boogaart
5/12/2004 10:17:12 PM
Hi all,

I am trying to associate a simple custom designer with an equally simple
windows form. Here is what I have:

public class MyDesigner : DocumentDesigner {
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!");
}
}

[Designer(typeof(MyDesigner), typeof(IRootDesigner)),
DesignerCategory("Form")]
public class Form1 : System.Windows.Forms.Form {
<snip>
}

At runtime I can report on the attribute value and see the correct result
(ie. it says my designer is in use). However, I can't see the new verb when
I am in the design view for Form1. What am I doing wrong?

TIA,
Kent

Re: Setting designer for form Kent Boogaart
5/14/2004 8:49:42 PM
Ah, thanks - now I get it.


[quoted text, click to view]

AddThis Social Bookmark Button