~a flips the bits in a, but doesn't save the result anywhere. On the next line, a is still equal to 0xffff. 0x marks that the value is written in hexadecimal (simlarly, a number preceded by a 0, such as 024, is written in octal). Lastly, and unsigned int is the same size as an int, which is 4 bytes on a 32-bit CPU and 8-bytes on a 64-bit CPU; perhaps you were thinking of a short int?
Anyways if you run the following code, you should get output of "0xffff0000" (assuming 4-byte int)
unsigned int a = 0xffff; // same as a = 0x0000ffff
a = ~a;
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...