Designer verbs on user controls

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I am trying to design a re-usable wizard control with design time
functionality to add and remove wizard "pages" (which will take the form of a
collection of panels onto which the developer will be able to add controls at
design time).

The class for the user control is this (not including the automatically
created .Designer.vb code):

Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Windows.Forms.Design


<Designer(GetType(MyWizardRootDesigner), _
GetType(IRootDesigner))> _
Public Class MyWizard
Inherits UserControl

'My code for handling back,next,cancel etc goes here

End Class


The designer is this:

Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Diagnostics
Imports System.Drawing.Design
Imports System.Windows.Forms
Imports System.Windows.Forms.Design

<System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand, Name:="FullTrust")> _
Public Class MyWizardRootDesigner
Inherits ParentControlDesigner

Public Overrides Sub Initialize(ByVal component As IComponent)
MyBase.Initialize(component)
Me.Verbs.Add(New DesignerVerb("Insert page", New
EventHandler(AddressOf OnVerbInsertPage)))
Me.Verbs.Add(New DesignerVerb("Delete current page", New
Eventhandler(AddressOf OnVerbDeletePage)))
End Sub

Private Sub OnVerbInsertPage(ByVal sender As Object, ByVal e As EventArgs)
MsgBox("This verb inserts a page") 'to test designer verb
End Sub

Private Sub OnVerbDeletePage(ByVal sender As Object, ByVal e As EventArgs)
MsgBox("This verb deletes a page") 'to test designer verb
End Sub

End Class


As you might have guessed, I've adapted this from one of the walkthroughs in
the online help. However, when I've built the project and added the control
to the form, it doesn't show the designer verbs and doesn't allow me to add
controls with the user control as parent.

Can anyone tell me where I'm going wrong?

Thanks in advance
.



Relevant Pages

  • Superfluous span tag displayed in MS.IDE from Custom Designer
    ... The control seems to working just fine but when I drag and drop ... I have looked closely at the custom designer class that I ... ' Developing Microsoft ASP.NET Server Controls and Components ... Imports System.Collections ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Re: Changing the background color of the selected item in a listbo
    ... This is an easy fix however so i'm going to post the code. ... Create a new project in VS.NET, choose "web control Library" as the project ... Imports System.ComponentModel ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Designer Property Serialization -- Sycning inner properties to designer property window
    ... the control, it's standard pattern in exposing complex objects in ASP.NEt ... Imports System.Collections.Generic ... properties window in Visual Studio.Net. ... with the properties in the designer window. ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Re: Transparent Label Control - Text Refresh Problem
    ... We have exactly the same problem with a transparent control we're working ... I am investigating some deep designer ... > Imports System.Windows.Forms.Design ... > 'Protected Overrides Sub OnLocationChanged ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: PDA application development
    ... Chris Tacke, Embedded MVP ... To get it to even work at all - not considering designer support ... write a COM interop wrapper around the control. ... "Michael Salamone" wrote: ...
    (microsoft.public.pocketpc.developer)