VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



constant values changes in visual basic .net important for those who are upgrading from VB6

by MOHAN GUPTA (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 30th January 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

constant values changes in visual basic .net important for those who are upgrading from VB6

API Declarations


'[email protected]


Rate constant values changes in visual basic .net important for those who are upgrading from VB6



'[email protected]



CONSTANT CHANGES IN VISUAL BASIC. NET

WindowState Constant Changes in Visual Basic .NET
Visual Basic6.0 Visual Basic .NET Equivalent
vbNormal (0) System.Windows.Forms.FormWindowState.Normal
vbMinimized (1) System.Windows.Forms.FormWindowState.Minimized
vbMaximized (2) System.Windows.Forms.FormWindowState.Maximized
Align Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
VbAlignNone (0) System.Windows.Forms.DockStyle.None
VbAlignTop (1) System.Windows.Forms.DockStyle.Top
VbAlignBottom (2) System.Windows.Forms.DockStyle.Bottom
VbAlignLeft (3) System.Windows.Forms.DockStyle.Left
VbAlignRight (4) System.Windows.Forms.DockStyle.Right

Alignment Constant Changes in Visual Basic .NET
CheckBox and OptionButton Alignment Constants

Visual Basic 6.0 Visual Basic .NET Equivalent
VbLeftJustify (0) System.Drawing.ContentAlignment.MiddleLeft
VbRightJustify (1) System.Drawing.ContentAlignment.MiddleRight

TextBox Alignment Constants

Visual Basic 6.0 Visual Basic .NET Equivalent
VbLeftJustify (0) System.Windows.Forms.HorizontalAlignment.Left
VbRightJustify (1) System.Windows.Forms.HorizontalAlignment.Right
VbCenter (2) System.Windows.Forms.HorizontalAlignment.Center

Label Alignment Constants

Visual Basic 6.0 Visual Basic .NET Equivalent
VbLeftJustify (0) System.Drawing.ContentAlignment.TopLeft
VbRightJustify (1) System.Drawing.ContentAlignment.TopRight
VbCenter (2) System.Drawing.ContentAlignment.TopCenter

Arrange Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
VbCascade (0) System.Windows.Forms.MDILayout.Cascade
VbTileHorizontal(1) System.Windows.Forms.MDILayout.TileHorizontal
VbTileVertical (2) System.Windows.Forms.MDILayout.TileVertical
VbArrangeIcons (3) System.Windows.Forms.MDILayout.ArrangeIcons
BorderStyle Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
VbBSNone (0) System.Windows.Forms.FormBorderStyle.None
VbFixedSingle (1) System.Windows.Forms.FormBorderStyle.FixedSingle
VbSizable (2) System.Windows.Forms.FormBorderStyle.Sizable
VbFixedDialog (3) System.Windows.Forms.FormBorderStyle.FixedDialog
VbFixedToolWindow (4) System.Windows.Forms.FormBorderStyle.FixedToolWindow
VbSizableToolWindow(5) System.Windows.Forms.FormBorderStyle.SizableToolWindow
CheckBox Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
vbUnchecked (0) System.Windows.Forms.CheckState.Unchecked
vbChecked (1) System.Windows.Forms.CheckState.Checked
vbGrayed (2) System.Windows.Forms.CheckState.Indeterminate
Color Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
VbBlack System.Drawing.Color.Black
VbRed System.Drawing.Color.Red
VbGreen System.Drawing.Color.Lime
vbYellow System.Drawing.Color.Yellow
VbBlue System.Drawing.Color.Blue
vbMagenta System.Drawing.Color.Magenta
VbCyan System.Drawing.Color.Cyan
VbWhite System.Drawing.Color.White

System Color Constant Equivalents

Visual Basic 6.0 Visual Basic .NET Equivalent
vb3DDKShadow System.Drawing.SystemColors.ControlDarkDark
vb3DFace System.Drawing.SystemColors.Control
vb3DHighlight System.Drawing.SystemColors.ControlLightLight
vb3DLight System.Drawing.SystemColors.ControlLight
vb3DShadow System.Drawing.SystemColors.ControlDark
vbActiveBorder System.Drawing.SystemColors.ActiveBorder
vbActiveTitleBar System.Drawing.SystemColors.ActiveCaption
vbActiveTitleBarText System.Drawing.SystemColors.ActiveCaptionText
vbApplicationWorkspace System.Drawing.SystemColors.AppWorkspace
vbButtonFace System.Drawing.SystemColors.Control
vbButtonShadow System.Drawing.SystemColors.ControlDark
vbButtonText System.Drawing.SystemColors.ControlText
vbDesktop System.Drawing.SystemColors.Desktop
vbGrayText System.Drawing.SystemColors.GrayText
vbHighlight System.Drawing.SystemColors.Highlight
vbHighlightText System.Drawing.SystemColors.HighlightText
vbInactiveBorder System.Drawing.SystemColors.InactiveBorder
vbInactiveCaptionText System.Drawing.SystemColors.InactiveCaptionText
vbInactiveTitleBar System.Drawing.SystemColors.InactiveCaption
vbInactiveTitleBarText System.Drawing.SystemColors.InactiveCaptionText
vbInfoBackground System.Drawing.SystemColors.Info
vbInfoText System.Drawing.SystemColors.InfoText
vbMenuBar System.Drawing.SystemColors.Menu
vbMenuText System.Drawing.SystemColors.MenuText
vbScrollBars System.Drawing.SystemColors.Scrollbar
vbTitleBarText System.Drawing.SystemColors.ActiveCaptionText
vbWindowBackground System.Drawing.SystemColors.Window
vbWindowFrame System.Drawing.SystemColors.WindowFrame
vbWindowText System.Drawing.SystemColors.WindowText
Translating Colors

To find an equivalent value for a Visual Basic 6.0 color that is not covered by the color constants, you can use the System.Drawing.ColorTranslator class.
The following example sets the BackColor property of a TextBox control to match the lightest green (&H00C0FFC0) from the Visual Basic 6.0 color picker:
' Visual Basic .NET 
textBox1.BackColor = System.Drawing.ColorTranslator.FromOle(&H00C0FFC0)
Compare Method Constant Changes in Visual Basic .NET
Note   For backward compatibility, the Visual Basic 6.0 Compare constants may also be used in Visual Basic .NET.

Visual Basic 6.0 Visual Basic .NET Equivalent
vbBinaryCompare CompareMethod.Binary
vbTextCompare CompareMethod.Text
vbDatabaseCompare No equivalent
Date Format Constant Changes in Visual Basic .NET
Note   For backward compatibility, the Visual Basic 6.0 Date Format constants may also be used in Visual Basic .NET.
Visual Basic 6.0 Visual Basic .NET Equivalent
vbGeneralDate DateFormat.GeneralDate
vbLongDate DateFormat.LongDate
vbShortDate DateFormat.ShortDate
vbLongTime DateFormat.LongTime
vbShortTime DateFormat.ShortTime
DayOfWeek Constant Changes in Visual Basic .NET
Note   For backward compatibility, the Visual Basic 6.0 DayOfWeek constants may also be used in Visual Basic .NET.
Visual Basic 6.0 Visual Basic .NET Equivalent
VbUseSystemDayOfWeek FirstDayOfWeek.System
vbSunday FirstDayOfWeek.Sunday
vbMonday FirstDayOfWeek.Monday
vbTuesday FirstDayOfWeek.Tuesday
vbWednesday FirstDayOfWeek.Wednesday
vbThursday FirstDayOfWeek.Thursday
vbFriday FirstDayOfWeek.Friday
vbSaturday FirstDayOfWeek.Saturday
File Attribute Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
vbNormal FileAttribute.Normal
vbReadOnly FileAttribute.ReadOnly
vbHidden FileAttribute.Hidden
vbSystem FileAttribute.System
vbVolume FileAttribute.Volume
vbDirectory FileAttribute.Directory
vbArchive FileAttribute.Archive
vbAlias No equivalent
Key Code Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
vbKeyLButton (1) System.Windows.Forms.Keys.LButton
vbKeyRButton (2) System.Windows.Forms.Keys.RButton
vbKeyCancel (3) System.Windows.Forms.Keys.Cancel
vbKeyMButton (4) System.Windows.Forms.Keys.MButton
vbKeyBack (8) System.Windows.Forms.Keys.Back
vbKeyTab (9) System.Windows.Forms.Keys.Tab
vbKeyClear (12) System.Windows.Forms.Keys.Clear
vbKeyReturn (13) System.Windows.Forms.Keys.Return
vbKeyShift (16) System.Windows.Forms.Keys.ShiftKey
vbKeyControl (17) System.Windows.Forms.Keys.ControlKey
vbKeyMenu (18) System.Windows.Forms.Keys.Menu
vbKeyPause (19) System.Windows.Forms.Keys.Pause
vbKeyCapital (20) System.Windows.Forms.Keys.Capital
vbKeyEscape (27) System.Windows.Forms.Keys.Escape
vbKeySpace (32) System.Windows.Forms.Keys.Space
vbKeyPageUp (33) System.Windows.Forms.Keys.PageUp
vbKeyPageDown (34) System.Windows.Forms.Keys.PageDown
vbKeyEnd (35) System.Windows.Forms.Keys.End
vbKeyHome (36) System.Windows.Forms.Keys.Home
vbKeyLeft (37) System.Windows.Forms.Keys.Left
vbKeyUp (38) System.Windows.Forms.Keys.Up
vbKeyRight (39) System.Windows.Forms.Keys.Right
vbKeyDown (40) System.Windows.Forms.Keys.Down
vbKeySelect (41) System.Windows.Forms.Keys.Select
vbKeyPrint (42) System.Windows.Forms.Keys.Print
vbKeyExecute (43) System.Windows.Forms.Keys.Execute
vbKeySnapshot (44) System.Windows.Forms.Keys.Snapshot
vbKeyInsert (45) System.Windows.Forms.Keys.Insert
vbKeyDelete (46) System.Windows.Forms.Keys.Delete
vbKeyHelp (47) System.Windows.Forms.Keys.Help
vbKeyNumlock (144) System.Windows.Forms.Keys.Numlock
vbKeyScrollLock (145) System.Windows.Forms.Keys.Scroll

Alphabetic Key Code Constants

Visual Basic 6.0 Visual Basic .NET Equivalent
VbKeyA (65) System.Windows.Forms.Keys.A
VbKeyB (66) System.Windows.Forms.Keys.B
VbKeyC (67) System.Windows.Forms.Keys.C
VbKeyD (68) System.Windows.Forms.Keys.D
VbKeyE (69) System.Windows.Forms.Keys.E
VbKeyF (70) System.Windows.Forms.Keys.F
VbKeyG (71) System.Windows.Forms.Keys.G
VbKeyH (72) System.Windows.Forms.Keys.H
VbKeyI (73) System.Windows.Forms.Keys.I
VbKeyJ (74) System.Windows.Forms.Keys.J
VbKeyK (75) System.Windows.Forms.Keys.K
VbKeyL( 76) System.Windows.Forms.Keys.L
vbKeyM (77) System.Windows.Forms.Keys.M
VbKeyN (78) System.Windows.Forms.Keys.N
VbKeyO (79) System.Windows.Forms.Keys.O
VbKeyP( 80) System.Windows.Forms.Keys.P
VbKeyQ (81) System.Windows.Forms.Keys.Q
VbKeyR (82) System.Windows.Forms.Keys.R
VbKeyS (83) System.Windows.Forms.Keys.S
VbKeyT (84) System.Windows.Forms.Keys.T
VbKeyU (85) System.Windows.Forms.Keys.U
VbKeyV (86) System.Windows.Forms.Keys.V
VbKeyW (87) System.Windows.Forms.Keys.W
VbKeyX (88) System.Windows.Forms.Keys.X
VbKeyY (89) System.Windows.Forms.Keys.Y
VbKeyZ (90) System.Windows.Forms.Keys.Z

Numeric Key Constants

Visual Basic 6.0 Visual Basic .NET Equivalent
vbKey0 (48) System.Windows.Forms.Keys.D0
vbKey1 (49) System.Windows.Forms.Keys.D1
vbKey2 (50) System.Windows.Forms.Keys.D2
vbKey3 (51) System.Windows.Forms.Keys.D3
vbKey4 (52) System.Windows.Forms.Keys.D4
vbKey5 (53) System.Windows.Forms.Keys.D5
vbKey6 (54) System.Windows.Forms.Keys.D6
vbKey7 (55) System.Windows.Forms.Keys.D7
vbKey8 (56) System.Windows.Forms.Keys.D8
vbKey9 (57) System.Windows.Forms.Keys.D9

Numeric Keypad Key Constants

Visual Basic 6.0 Visual Basic .NET Equivalent
vbKeyNumpad0 (96) System.Windows.Forms.Keys.NumPad0
vbKeyNumpad1 (97) System.Windows.Forms.Keys.NumPad1
vbKeyNumpad2 (98) System.Windows.Forms.Keys.NumPad2
vbKeyNumpad3 (99) System.Windows.Forms.Keys.NumPad3
vbKeyNumpad4 (100) System.Windows.Forms.Keys.NumPad4
vbKeyNumpad5 (101) System.Windows.Forms.Keys.NumPad5
vbKeyNumpad6 (102) System.Windows.Forms.Keys.NumPad6
vbKeyNumpad7 (103) System.Windows.Forms.Keys.NumPad7
vbKeyNumpad8 (104) System.Windows.Forms.Keys.NumPad8
vbKeyNumpad9 (105) System.Windows.Forms.Keys.NumPad9
VbKeyMultiply (106) System.Windows.Forms.Keys.Multiply
VbKeyAdd (107) System.Windows.Forms.Keys.Add
VbKeySeparator (108) System.Windows.Forms.Keys.Separator
VbKeySubtract (109) System.Windows.Forms.Keys.Subtract
VbKeyDecimal (110) System.Windows.Forms.Keys.Decimal
VbKeyDivide (111) System.Windows.Forms.Keys.Divide


Function Key Constants

Visual Basic 6.0 Visual Basic .NET Equivalent
vbKeyF1 (112) System.Windows.Forms.Keys.F1
vbKeyF2 (113) System.Windows.Forms.Keys.F2
vbKeyF3 (114) System.Windows.Forms.Keys.F3
vbKeyF4 (115) System.Windows.Forms.Keys.F4
vbKeyF5 (116) System.Windows.Forms.Keys.F5
vbKeyF6 (117) System.Windows.Forms.Keys.F6
vbKeyF7 (118) System.Windows.Forms.Keys.F7
vbKeyF8 (119) System.Windows.Forms.Keys.F8
vbKeyF9 (120) System.Windows.Forms.Keys.F9
vbKeyF10 (121) System.Windows.Forms.Keys.F10
vbKeyF11 (122) System.Windows.Forms.Keys.F11
vbKeyF12 (123) System.Windows.Forms.Keys.F12
vbKeyF13 (124) System.Windows.Forms.Keys.F13
vbKeyF14 (125) System.Windows.Forms.Keys.F14
vbKeyF15 (126) System.Windows.Forms.Keys.F15
vbKeyF16 (127) System.Windows.Forms.Keys.F16
MultiSelect Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
vbMultiSelectNone (0) System.Windows.Forms.SelectionMode.One
vbMultiSelectSimple (1) System.Windows.Forms.SelectionMode.MultiSimple
VbvbMultiSelectExtended(2) System.Windows.Forms.SelectionMode.MultiExtended
Mouse Pointer Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
VbDefault (0) Windows.Forms.Cursors.Default
VbArrow (1) Windows.Forms.Cursors.Arrow
VbCrosshair (2) Windows.Forms.Cursors.Cross
VbIbeam (3) Windows.Forms.Cursors.Ibeam
VbIconPointer (4) Obsolete — replaced by System.Windows.Forms.Cursors.Default
VbSizePointer (5) Windows.Forms.Cursors.SizeAll
VbSizeNESW (6) Windows.Forms.Cursors.SizeNESW
VbSizeNS (7) Windows.Forms.Cursors.SizeNS
VbSizeNWSE (8) Windows.Forms.Cursors.SizeNWSE
VbSizeWE (9) Windows.Forms.Cursors.SizeWE
VbUpArrow (10) Windows.Forms.Cursors.UpArrow
VbHourglass (11) Windows.Forms.Cursors.WaitCursor
VbNoDrop (12) System.Drawing.Cursurs.NoDrop
VbArrowHourglass (13) Windows.Forms.Cursors.AppStarting
VbArrowQuestion (14) Windows.Forms.Cursors.Help
VbSizeAll (15) Windows.Forms.Cursors.SizeAll
VbCustom (99) No equivalent — 
MsgBox Result Constant Changes in Visual Basic .NET
Note   For backward compatibility, the Visual Basic 6.0 MsgBox Result constants may also be used in Visual Basic .NET.
Visual Basic 6.0 Visual Basic .NET Equivalent
VbOK MsgBoxResult.OK
VbCancel MsgBoxResult.Cancel
VbAbort MsgBoxResult.Abort
VbRetry MsgBoxResult.Retry
VbIgnore MsgBoxResult.Ignore
VbYes MsgBoxResult.Yes
vbNo MsgBoxResult.No


MsgBox Style Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
vbOKOnly MsgBoxStyle.OKOnly
vbOKCancel MsgBoxStyle.OKCancel
vbAbortRetryIgnore MsgBoxStyle.AbortRetryIgnore
vbYesNoCancel MsgBoxStyle.YesNoCancel
vbYesNo MsgBoxStyle.YesNo
vbRetryCancel MsgBoxStyle.RetryCancel
vbCritical MsgBoxStyle.Critical
vbQuestion MsgBoxStyle.Question
vbExclamation MsgBoxStyle.Exclamation
vbInformation MsgBoxStyle.Information
vbDefaultButton1 MsgBoxStyle.DefaultButton1
vbDefaultButton2 MsgBoxStyle.DefaultButton2
vbDefaultButton3 MsgBoxStyle.DefaultButton3
vbDefaultButton4 No equivalent
vbApplicationModal MsgBoxStyle.ApplicationModal
vbSystemModal MsgBoxStyle.SystemModal
vbMsgBoxHelpButton MsgBoxStyle.MsgBoxHelp
vbMsgBoxRight MsgBoxStyle.MsgBoxRight
vbMsgBoxRtlReading MsgBoxStyle.MsgBoxRtlReading
vbMsgBoxSetForeground MsgBoxStyle.MsgBoxSetForeground
OLEDropEffect Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
VbDropEffectNone (0) System.Windows.Forms.DragDropEffects.None
VbDropEffectCopy (1) System.Windows.Forms.DragDropEffects.Copy
VbDropEffectMove (2) System.Windows.Forms.DragDropEffects.Move
VbDropEffectScroll (&H80000000) System.Windows.Forms.DragDropEffects.Scroll
ScrollBar Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
vbSBNone (0) System.Windows.Forms.ScrollBars.None
vbHorizontal (1) System.Windows.Forms.ScrollBars.Horizontal
vbVertical (2) System.Windows.Forms.ScrollBars.Vertical
vbBoth (3) System.Windows.Forms.ScrollBars.Both
StrConv Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
vbUpperCase VbStrConv.UpperCase
vbLowerCase VbStrConv.LowerCase
vbProperCase VbStrConv.ProperCase
vbWide VbStrConv.Wide
vbNarrow VbStrConv.Narrow
vbKatakana VbStrConv.Katakana
vbHiragana VbStrConv.Hiragana
vbUnicode No equivalent
vbFromUnicode No equivalent
VarType Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
VbEmpty VariantType.Empty
VbNull VariantType.Null
VbInteger VariantType.Short
VbLong VariantType.Integer
VbSingle VariantType.Single
VbDouble VariantType.Double
VbCurrency VariantType.Decimal
VbDate VariantType.Date
VbString VariantType.String
VbObject VariantType.Object
VbError VariantType.Error
VbBoolean VariantType.Boolean
VbVariant VariantType.Variant
VbDataObject VariantType.DataObject
VbDecimal VariantType.Decimal
VbByte VariantType.Byte
vbUserDefinedType VariantType.UserDefinedType
VbArray VariantType.Array
VBA Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
VbBack ControlChars.Back
VbCr ControlChars.Cr
VbCrLf ControlChars.CrLf
vbFormFeed ControlChars.FormFeed
vbLf ControlChars.Lf
vbNewLine ControlChars.NewLine
vbNullChar ControlChars.NullChar
vbNullString Nothing keyword
vbObjectError VbObjectError
vbTab ControlChars.Tab
WeekOfYear Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
VbUseSystem FirstWeekOfYear.System
VbFirstJan1 FirstWeekOfYear.Jan1
vbFirstFourDays FirstWeekOfYear.FirstFourDays
vbFirstFullWeek FirstWeekOfYear.FirstFullWeek
WindowStyle Constant Changes in Visual Basic .NET
Visual Basic 6.0 Visual Basic .NET Equivalent
vbHide AppWinStyle.Hide
vbNormalFocus AppWinStyle.NormalFocus
vbMinimizedFocus AppWinStyle.MinimizedFocus
vbMaximizedFocus AppWinStyle.MaximizedFocus
vbNormalNoFocus AppWinStyle.NormalNoFocus
vbMinimizedNoFocus AppWinStyle.MinimizedNoFocus
Style Constant Changes in Visual Basic .NET
ComboBox Style Constants

Visual Basic 6.0 Visual Basic .NET Equivalent
vbComboDropdown (0) System.Windows.Forms.ComboBoxStyle.DropDown
vbComboSimple (1) System.Windows.Forms.ComboBoxStyle.Simple
vbComboDropdownList(2) System.Windows.Forms.ComboBoxStyle.DropDownList


CheckBox and OptionButton Style Constants

Visual Basic 6.0 Visual Basic .NET Equivalent
VbButtonStandard (0) System.Windows.Forms.Appearance.Normal
VbButtonGraphical (1) System.Windows.Forms.Appearance.Button



MOHAN KUMAR GUPTA 
SSI LIMITED
C-10 SECTOR 12 NOIDA



Download this snippet    Add to My Saved Code

constant values changes in visual basic .net important for those who are upgrading from VB6 Comments

No comments have been posted about constant values changes in visual basic .net important for those who are upgrading from VB6. Why not be the first to post a comment about constant values changes in visual basic .net important for those who are upgrading from VB6.

Post your comment

Subject:
Message:
0/1000 characters