Questions tagged [vb.net]

Visual Basic .NET is a .NET oriented-object implementation and evolution of Visual Basic developed by Microsoft.

Visual Basic .NET is a .NET oriented-object implementation and evolution of Visual Basic developed by Microsoft. The first implementation, for .NET 1.0, was nicknamed "Visual Basic .NET (2002)".

Since Visual Basic 2005, the third .NET version of Visual Basic, Microsoft has decided to drop the ".NET" portion of the title.

Apart from the syntax which has seen some additions between VB and the latest VB.NET version, there are much more important differences such as:

  • the semantics; VB runs on a deterministic, reference-counted engine based on COM whereas VB.NET is a fully oriented-object language running on the .NET Framework, and as such on the CLR (Common Language Runtime).
  • the library is much larger in VB.Net than in VB. Some functions and libraries no longer exist in VB. Although VB6 code will be successfully migrated to VB.Net it is very often necessary to refactor to obtain better performance.

Please note that purely "debate" questions on the choice between C# and VB.NET will be closed.

Also, please avoid combining the C# and VB.Net tags if the question is only related to one of those languages.

131 questions
5
votes
5 answers

Inner workings of the IF() function - why aren't expressions evaluated?

Short version How does the IF() function cause the passed expressions to NOT be evaluated prior to being passed in as parameters? Detailed version I am part of a standards committee, and a discussion was initiated which, in general, is trying to ban…
Suamere
  • 1,108
4
votes
2 answers

Does 'Me' in VB.NET refer to the instantiated object only?

Does 'Me' in VB.NET refer only to an instantiation of the type? Just occurred to me that since I can reference properties in my VB.NET class without using 'Me', that I don't see a reason for using it for this purpose. Will referencing the variable…
4
votes
2 answers

I want to turn VB.Net Option Strict On

I recently found out about strong typing in VB.Net (naturally it was on here, thanks!) and am deciding I should take another step toward being a better programmer. I went from vba macros -> VB.Net, because I needed a program that I could automate…
asjohnson
  • 476
3
votes
3 answers

Is it bad practice to register assemblies in the GAC?

I have moved a few assemblies to the Global Assembly Cache because they are used by multiple applications i.e. a VB.NET app and an ASP.NET app. I remember a few years ago when I started in my current role I noticed that the previous developer…
w0051977
  • 7,081
3
votes
2 answers

Why And is needed when there is AndAlso

I have referred What is the difference between And and AndAlso in VB.net? to understand the difference between And and AndAlso. I am from C# background - and C# has AndAlso only - no And.. And I don't see any practical use/advnatage of And. Is…
LCJ
  • 987
3
votes
3 answers

Declare variable as interface

When should or shouldn't a variable be declared as a custom Interface type? When walking through some code, I required to know what was happening here: Public Class MyMainProject .... Public Sub DoMyWork() Dim objIMyInterface As…
Suamere
  • 1,108
2
votes
4 answers

Do I really need to stop the timers that do nothing?

I have a sample code here: Dim a As Boolean = False Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick If a = True Then Console.WriteLine("Example of a task that needs to be done during tick event") End…
1
vote
1 answer

How can regular expression be ambiguous?

I am recoqnizing this pattern <.*> From string Hi Baby Now, there are several match is a match Hi Baby is also a match. However, that's very confusing. I thought regular…
user4951
  • 709
  • 6
  • 14
0
votes
3 answers

Understanding VB.NET variable scope

What's the difference between this code snippet: Sub Test() Dim i as Integer = 0 Dim q as String = "" While i<10 q=String.Format("Some text {0}", i) Console.WriteLn(q) i=i+1 End While End Dub and this one: Sub Test() Dim i as…
David
  • 31
0
votes
2 answers

Where can I get a definition of how the code is laid out in VB.NET 2010?

I am just starting out learning Visual Basic 2010. I have books and videos. The books all seem to be written for people who have some programming experience, even the books that say they are for beginners. The videos were great until they started…
ByteWorker
  • 21
  • 1