Windows Forms designer sample demoed in VB (VBWinFormDesigner)

The code sample demonstrates various typical programming scenarios in Windows Forms Designer

VB.NET (85.1 KB)
4 Star
17,177 times
Add to favorites
E-mail Twitter Digg Facebook
       WINDOWS FORMS APPLICATION : VBWinFormDesigner Project Overview
                   EnableDesignTimeFuncForChildCtrl Sample


The EnableDesignTimeFuncOnChildCtrl sample demonstrates how to enable design 
time functionality on for a child control.


Main Steps:

1. Create a UserControl named "EnableDesignTimeFuncOnChildCtrl";

2. Drag a Panel control to the UserControl;

3. Create a public property named "Panel1" with only a getter; 

4. Add a reference to the System.Designer.dll;

5. Create a class named "UC_EnableDesignTimeFuncForChildCtrlDesigner" derive 
   from the ControlDesigner class;

6. Override the ControlDesigner.Initialize method and call EnableDesignMode 
   method to enable design time functionality for the panel;
7. Specify the Designer attribute for the UserControl as follows:

     <Designer(GetType(UC_EnableDesignTimeFuncForChildCtrlDesigner))> _

8. Enable design time serialization on the panel by setting the 
   DesignerSerializationVisibility attribute as follows:
9. Build the project, after the compiling succeed, a UserControl 
   "EnableDesignTimeFuncOnChildCtrl" should be appear on the toolbox; 
10. Drag the "EnableDesignTimeFuncOnChildCtrl" UserControl from the toolbox 
    to the form;
11. You'll find you're able to edit the panel, you  can also drag controls 
    onto the panel;

1. DesignerAttribute Class
2. ControlDesigner.EnableDesignMode Method
3. DesignerSerializationVisibilityAttribute Class