1. Technology
A Better Way To Inherit?
Elijah Taylor Shows About Visual Basic A Better Way !!

A recent two part article about Visual Inheritance (Part One: HERE and Part Two: HERE) demonstrated one way to implement Visual Inheritance using the VB .NET Standard Edition that you can get for about five or six hundred dollars less than the full Visual Studio. (See THIS ARTICLE for more.) While our original method works (and there are still good reasons to do it this way) an About Visual Basic reader wrote to tell us he knows a better way.

Elijah Taylor, a Systems Analyst for WWTV/WWUP-TV 9&10 News from Michigan, wrote:

Here's what I do ...

In the .vbproj file, look for ...
  
OutputType = "WinEXE"

Just change it to ...

OutputType = "Library"

And make sure that ...

StartupObject="" 

And recompile.  Viola!

Right you are, Elijah! And to show our appreciation, we'll be sending you your choice of one of these books:

Programming .NET Web Services by Ferrara & MacDonald (O'Reilly)

Real World XML Web Services by Shohoud (Addison Wesley)

Visual Basic Design Patterns by Cooper (Addison Wesley)

ASP.NET and VB.NET Programming by Crouch (Addison Wesley)

Object-Oriented Programming with Visual Basic .NET by Hamilton (O'Reilly)

Just so you know that I didn't take Elijah's word for it, here's a little more detail about implementing his method.

Just like Elijah said, first you change the .vbproj file as shown below. Notepad, or any ASCII editor, works fine since this is a great example of Microsoft's new focus on XML for meta information.

Changing vbproj

If you do this with the project open, VB .NET notices that things are different and asks if you want to reload the project. You must select Reload to create the DLL since Visual Studio has to reconfigure internal flags based on the contents of vbproj. Visual Studio then shuts down and you have to select the same solution for loading again. For this reason, it's probably less confusing to simply close down Visual Studio and then edit vbproj.

Reload Option

Once you do this, it's possible to browse to the Inherited Form in much the same way documented in the previous article.

New Results

©2014 About.com. All rights reserved.