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 / May 2004

Tip: Looking for answers? Try searching our database.

Setting designer for form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kent Boogaart - 12 May 2004 13:47 GMT
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
Stoitcho Goutsev \(100\) [C# MVP] - 12 May 2004 21:35 GMT
Hi Kent,

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

Signature

Stoitcho Goutsev (100) [C# MVP]

> Hi all,
>
[quoted text clipped - 27 lines]
> TIA,
> Kent
Kent Boogaart - 14 May 2004 12:19 GMT
Ah, thanks - now I get it.

> Hi Kent,
>
[quoted text clipped - 33 lines]
> > TIA,
> > Kent

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.