The real answer:
txtModule.Visible = (cboModule.SelectedIndex = 0)
is actually
Let txtModule.Visible = (cboModule.SelectedIndex = 0)
where the equals sign plays two roles.
In the first role, it is part of the syntax of Let, as in Let variable = expression
. The Let
is rarely used, because as BASIC evolved, it became optional (see http://msdn.microsoft.com/en-us/library/aa243390(v=vs.60).aspx). This is just how BASIC (and VB6 and VBA) does its assignment statement (see http://en.wikipedia.org/wiki/Assignment_(computer_science) ).
Actually, VB.NET doesn't use Let
, but the usage of equals sign in this first role continues on.
In the second role, it is the equality operator, generally equivalent to ==
of C# (but not exactly, see Object equality behaves different in .NET )
In some languages, assignment is a statement (such as VB.Net), and in others it's an operator (such as C#). Per the Wiki page cited above: "The use of the equals sign as an assignment operator has been frequently criticized, due to the conflict with equals as comparison for equality. This results both in confusion by novices in writing code, and confusion even by experienced programmers in reading code." Apparently, Fortran is to blame.