Click here to Skip to main content
13,297,266 members (65,952 online)
Click here to Skip to main content
Add your own
alternative version


40 bookmarked
Posted 11 Aug 2004

Automate code-writing in VB.NET control's development

, 11 Aug 2004
Rate this:
Please Sign up or sign in to vote.
Utility for automating code writing for VB.NET control's developers


When you develop a new control in .NET Framework often reuse standard controls as textboxes , buttons etc…

Commonly we have to replicate, at control level , properties of a child control and is a very tedious work to hand-write the code for all hosted properties.


Look, for example at this control

sample control

Probably the Control should have properties similar to child controls

In this case, for example, Control's Text property should be textbox property

Well so you must manually rewrite all properties statements in this way:

Public Property BoxText() As String
            Return Me.TextBox1.Text
        End Get
        Set(ByVal Value As String)
            Me.TextBox1.Text = Value
        End Set
 End Property

That is a very tedious work, considering that much properties as similars (like Font, Background and so on)

Class Inspector

Class Inspector can spy and recreate properties declarations of controls, components enums and other classes containeds in an assembly.

You can load any .NET assembly and in the left treeView will be loaded all assembly referenced in it (if you don't specify an assembly with menu item "File/Get references from an assembly" will be loaded the program assembly itself).

You can now navigate in tree nodes to class/enum that you want inspect and, by clicking on this, in right text panel will be appears VB code for properties declararations of inspected class.

The code can be browsed,copied and saved. You can also define a Prefix for properties names, so if you define i.e. Btn the Text property declaration appear as

Private _BtnText as System.String
<Description("The text contained in the control.")> _
Public  Property BtnText as System.String
       return _BtnText
   End Get
   Set (Value as System.String)
   End Set
End Property

You can, moreover, define a language different from default (English) by setting relative combobox

If i.e. I set language to Italian (and if my .NET framework distribution supports this language) the precendent property declaration will appears as

Private _BtnText as System.String
<Description("Il testo contenuto nel controllo.")> _
Public  Property BtnText as System.String
       return _BtnText
   End Get
   Set (Value as System.String)
   End Set
End Property

That is Description attributes will be translate in the selected language.


The source project was written with Visual Studio 2003 and the program was tested with .NET framework v.1.1

In my site is also avaible a setup package


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Francesco Smelzo
Web Developer
Italy Italy
Francesco Smelzo is a free-lance developer that live and work in Italy,he is specialized on microsoft platform development and in web projects.

He is specially skilled on VB.NET, XML,XSL and most of web scripting languages.

You may also be interested in...


Comments and Discussions

GeneralMy vote of 5 Pin
aaroncampf31-Dec-10 20:01
memberaaroncampf31-Dec-10 20:01 
Generalhehehehe..... Pin
noor_adilah11-Feb-07 19:15
membernoor_adilah11-Feb-07 19:15 
GeneralGreat Pin
aKriss6-Feb-05 17:45
memberaKriss6-Feb-05 17:45 
Thank you very much!!
GeneralSweet Pin
Aaron Eldreth12-Aug-04 7:24
memberAaron Eldreth12-Aug-04 7:24 
GeneralRe: Sweet Pin
Francesco Smelzo12-Aug-04 7:58
memberFrancesco Smelzo12-Aug-04 7:58 
GeneralRe: Sweet Pin
Aaron Eldreth12-Aug-04 9:45
memberAaron Eldreth12-Aug-04 9:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171207.1 | Last Updated 12 Aug 2004
Article Copyright 2004 by Francesco Smelzo
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid