Changes in Controls from VB6 to VB.net

By: Steven Holzner Emailed: 1676 times Printed: 2159 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

In fact, the Caption property no longer exists; it's been replaced by the Text property. There are other changes in controls from VB6 as well—and plenty of them.  I'll take a look at a number of general points here to start us off.

There are no more control arrays. In VB6 and before, you could assemble controls into arrays, and handle events from all those controls in one place. But in an effort to standardize the way event-handling procedures work, VB .NET has removed support for control arrays.

Also, in Visual Basic 6.0, coordinates for forms and controls were expressed in twips (1/1440ths of an inch); in Visual Basic .NET, coordinates are expressed in pixels—and only pixels, you can't change to other scales.

Default properties for controls are no longer supported for objects, which includes controls, in VB .NET (unless those properties take arguments). For example, in VB6, you could write:

Text1 = "Hello from Visual Basic"

This would assign the text "Hello from Visual Basic" to the Text property of the text box Text1, because Text was this control's default property. In VB .NET, however, the default name for this control would be TextBox1, and if you want to assign a value to its Text property, you must do so explicitly:

TextBox1.Text = "Hello from Visual Basic"

There are also changes to help internationalize Visual Basic; for example, you'll now find that controls have an ImeMode property, which stands for Input Method Editor, allowing controls to accept input in various international modes, such as Katakana.

The default names for controls have changed—for example, in VB6, the default name for a text box was Text1, in VB .NET, it's TextBox1; List1 has become ListBox1, Command1 has become Button1, Option1 has become RadioButton1, and so on.

You'll also find changes in the names of many events (DblClick is now DoubleClick, for example), properties (selText is now SelectedText, for example), and in the arguments passed to event handlers. You also can now anchor and dock controls. We'll see other changes on a control-by-control basis, but these are some to keep in mind.


VB.net Home | All VB.net Tutorials | Latest VB.net Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(0)


Be the first one to add a comment

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Steven Holzner
Changes in Controls from VB6 to VB.net
Throwing a Custom Exception in VB.net
Throwing an Exception in VB.net
Using Finally in VB.net
Using Multiple Catch Statements in VB.net
Exception Filtering in the Catch Block in VB.net
Raising an Exception Intentionally in VB.net
Getting an Exception's Number and Description in VB.net
Using On Error GoTo 0 in VB.net
Using Resume Next and Resume Line in VB.net
Understanding Scope in VB.net
Properties in VB.net
Procedure Delegates in VB.net
Preserving a Variable's Values between Procedure Calls in VB.net
Specifying Optional Arguments with default values in Procedures in VB.net

More Tutorials in VB.net
Scope in VB.net
Unstructured Exception Handling in VB.net
Structured Exception Handling in VB.net
Creating Sub Procedures in VB.net
Creating Functions in VB.net
Passing a Variable Number of Arguments to Procedures in VB.net
Specifying Optional Arguments with default values in Procedures in VB.net
Preserving a Variable's Values between Procedure Calls in VB.net
Procedure Delegates in VB.net
Properties in VB.net
Understanding Scope in VB.net
Using Resume Next and Resume Line in VB.net
Using On Error GoTo 0 in VB.net
Getting an Exception's Number and Description in VB.net
Raising an Exception Intentionally in VB.net

More Latest News
Most Viewed Articles (in VB.net )
Your first VB.NET Crystal Reports - A step by step guide
Arrays and Dynamic Arrays in VB.net
Using Resume Next and Resume Line in VB.net
A tutorial on Chat Server and Chat Client in VB.net
DataRow Class in VB.net
Using the ServiceBase Class in VB.net
File Extensions Used in VB .NET
Converting between Data Types in VB.net
Operators in VB.net
Do Loop in VB.net
For Each…Next Loop in VB.net
Name Value Collecion in VB.net
How to Open and Edit Cells in an Excel 2007 file in VB.NET
To read the entire worksheet in an Excel workbook through VB.net Code
How to export from DataGridView to excel using VB.net
Most Emailed Articles (in VB.net)
Send SMS using VB code
String equals, Copy to & Copy to in VB.net
How to export from database to excel using VB.net
A tutorial on Chat Server and Chat Client in VB.net
String.Contains (), compare, clone in VB.net
Your first VB.NET Crystal Reports - A step by step guide
Using a Web Service in VB.net
Using Excel 2007 Chart in VB.NET 2005
How to export from DataGridView to excel using VB.net
Socket Programming in VB.net
Handling Timer Events - and Creating an Alarm Clock in VB.net
Using Resume Next and Resume Line in VB.net
File Extensions Used in VB .NET
Using Select Case in VB.net
For Loop in VB.net