VB.NET Frequently Asked Questions
Public Sub Main() indicates the entry point of VB.Net program.
VB.NET was created in order to make Visual Basic 6 developers transition to .NET easier. Under the covers, not much differences. Both C# and VB.NET are compiled into the same Common Intermediate Language, which is then complied into machine code. They share the same runtime engine (for memory management etc.) and libraries.
Check here for a Complete Comparison for VB.NET and C#
New Keyword is to create a new object instance, specifies a constructor constraint on a type parameter, or identifies a Sub procedure as a class constructor. You can use a New clause in a declaration statement or an assignment statement. When the statement runs, it calls the appropriate constructor of the specified class, passing any arguments you have supplied.
The tracing is the help in your application for debugging and bug fixing. Trace produces messages about program conditions even after application is compiled and released without interrupting application execution.
The default boolean value is False in VB.Net
Only one language is there in a .Net DLL
You use the Const statement to declare a constant and set its value.
Ansi keyword specifies that Visual Basic should marshal all strings to American National Standards Institute (ANSI) values regardless of the name of the external procedure being declared.
ReDim keyword resizes an array. We specify the maximum number of elements we want the array to have. ReDim then creates a new array of that size.
In VB.Net, a function can return a value to the calling code in two ways -
By using the return statement.
By assigning the value to the function name.
By using the params keyword, a method parameter can be specified which takes a variable number of arguments or even no argument.
Option Strict On
Using NEW keyword
Since VB.Net Adheres to Common Type system it is possible to derive a class written in VB.Net in C#.
You should send a button as sender into the event handler:
btnStart_Click(btnStart, New EventArgs())
- By Reference argument (ByRef )
- Dictionary object
In VB MDI form is created by adding MDI Form to the project and adding child forms by setting MDICHILD property of the child form.
In .NET there is no MDI form, any form can be made a MDI parent by setting IsMdiContainer property to TRUE.
The equivalent of the C# Static method modifier in VB.net is "Shared".