Home
About Tutorials
Remove Background
Add Image
Map Network Drive
Variable Naming
VB6 to VB.NET
VB.NET to C#
Site Navigation
About
20AE Registry
FAHR Registry
GLI Registry
Movies
Games
Graphics
Programs
Tutorials
Sitemap
About Tutorials
Remove Background
Add Image
Map Network Drive
Variable Naming
VB6 to VB.NET
VB.NET to C#
VB6 to VB.NET
If you're like me, you'll be trying to understand some of the changes to VB6 now that it has evolved into VB.NET. Below is a list of what the code was in VB6, followed by the new way of doing it in VB.NET.
VB6
DoEvents
VB.NET
System.Windows.Forms.Application.DoEvents()
VB6
Command1.BackColor = vbRed
VB.NET
Command1.BackColor = System.Drawing.Color.Red
VB6
ComboBox1.AddItem "one"
VB.NET
ComboBox1.Items.Add("one")
VB6
Command1.BackColor = &H80C0FF
VB.NET
Command1.BackColor = System.Drawing.ColorTranslator.FromOle(&H80C0FF&)
VB6
Form1.Caption = "Sample"
VB.NET
Form1.Text = "Sample"
VB6
MsgBox "message", vbInformation, "title"
VB.NET
MessageBox.Show("message", "title", , MessageBoxIcon.Information)
VB6
Set MyObject = Command1
VB.NET
MyObject = Command1
VB6
Text1.SetFocus
VB.NET
Text1.Focus()
VB6
Command1.ToolTipText = "click me"
VB.NET
ToolTip1.SetToolTip(Command1, "click me")
VB6
Dim objAbout As AboutForm
VB.NET
Dim objAbout As Pharfruminsain_AboutForm_v1r0.AboutForm
VB6
sPath = App.Path
VB.NET
sPath = System.Environment.CurrentDirectory
VB6
Private Sub Form_Unload(Cancel As Integer)
VB.NET
Private Sub Form1_Closing(...) Handles MyBase.Closing
VB6
List1.RemoveItem (0)
VB.NET
ListBox1.Items.Remove(0)
VB6
Dim arOne(10) As String
VB.NET
Dim arOne As New ArrayList(10)
VB6
Open "c:\myfile.txt" For Input As #1
VB.NET
FileOpen(1, "c:\myfile.txt", OpenMode.Input)
VB6
Line Input #1, sTemp
VB.NET
sTemp = LineInput(1)
VB6
Print #1, "sample text"
VB.NET
PrintLine(1, "sample text")
VB6
Public Type CustomArray
VB.NET
Public Structure CustomArray
VB6
Dim xRed As OLE_COLOR
VB.NET
Dim xRed As System.Drawing.Color
VB6
List1.ListIndex = List1.ListCount - 1
VB.NET
List1.SelectedIndex = List1.Items.Count - 1
VB6
Me.MousePointer = vbHourglass
VB.NET
Cursor.Current = Cursors.WaitCursor
VB6
Private Sub Label1_Change()
VB.NET
Private Sub Label1_TextChanged(....) Handles Label1.TextChanged
VB6
Form2.Show
VB.NET
Dim xForm As New Form2() xForm.Show()
VB6
sModelOfCar = Trim(sModelOfCar)
VB.NET
sModelOfCar = sModelOfCar.Trim()
VB6
iCount = iCount + 1
VB.NET
iCount += 1
VB6
sText = sText & "hello"
VB.NET
sText += "hello"
VB6
TextBox1.Text = ""
VB.NET
TextBox1.Clear()
VB6
Unload Me
VB.NET
Me.Dispose