VB & VB. NET quick query table

Source: Internet
Author: User

Event

VB6: doevents

VB. NET: system. Windows. Forms. application. doevents ()

Color
VB6: command1.backcolor = vbred

VB. NET:

Command1.backcolor = system. Drawing. color. Red
Command1.backcolor = system. Drawing. color. fromargb (& h80c0ff)

List in the combo box:

VB6: combobox1.additem "one"

VB. NET: combobox1.items. Add ("one ")

Color:
VB6: command1.backcolor = & h80c0ff

VB. NET: command1.backcolor = system. Drawing. colortranslator. fromole (& h80c0ff &)

Form:

VB6: form1.caption = "sample"

VB. NET: form1.definstance. Text = "sample"

VB6: form1.top

VB. NET: form1.definstance. Top

Message box:
VB: msgbox "message", vbinformation, "title"

VB. NET: msgbox ("message", msgboxstyle. Information, "title ")

Form height:
VB6: form1.height = 3500

VB. NET: form1.definstance. Height = vb6.twipstopixelsy (3500)

Object assignment:
VB6: Set myobject = command1

VB. NET: myobject = command1

Control focus:

VB6: text1.setfocus

VB. NET: text1.focus ()

Tip:

VB6: command1.tooltiptext = "Click me"

VB. NET: tooltip1.settooltip (command1, "click me ")

Form declaration:

VB6: dim objabout as aboutform

VB. NET: dim objabout as pharfruminsain_aboutform_v1r0.aboutform

FetchProgramPath

VB6: Spath = app. Path

VB. NTE: Spath = application. startuppath

VB6: private sub form_unload (cancel as integer)

VB. NET: private sub form1_closed (...) handles mybase. Closed

VB6: list1.removeitem (0)

VB. NET: listbox1.items. Remove (0)

VB. NET: dim Arone (10) as string

VB6: dim arone as new arraylist (10)

VB6: Print #1, "sample text"

VB. NET: printline (1, "sample text ")

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:
S = app. Comments
VB. NET:
Imports system. Diagnostics
Imports system. Reflection
S = fileversioninfo. getversioninfo ([Assembly]. getexecutingassembly. Location). Comments
 

VB6:
S = app. companyName
VB. NET:
Imports system. Diagnostics
Imports system. Reflection
S = fileversioninfo. getversioninfo ([Assembly]. getexecutingassembly. Location). companyName)

VB6:
S = app. exename
VB. NET:
Imports system. Reflection
With new system. Io. fileinfo ([Assembly]. getexecutingassembly. Location)
S =. Name. substring (0,. Name. Length-. extension. length)
End
Or
S = system. appdomain. currentdomain. friendlyname
Note: This parameter des the extension which wowould need to be parsed.

VB6:
S = app. filedescription
VB. NET:
Imports system. Diagnostics
Imports system. Reflection
S = fileversioninfo. getversioninfo ([Assembly]. getexecutingassembly. Location). filedescription)

VB6:
App. helpfile
VB. NET:
No direct replacement

VB6:
I = app. hinstance
VB. NET:
Imports system. runtime. interopservices
I = marshal. gethinstance ([Assembly]. getexecutingassembly. getmodules () (0). toint32

VB6:
S = app. legalcopyright
VB. NET:
Imports system. Diagnostics
Imports system. Reflection
S = fileversioninfo. getversioninfo ([Assembly]. getexecutingassembly. Location). legalcopyright)

VB6:
S = app. legaltrademarks
VB. NET:
Imports system. Diagnostics
Imports system. Reflection
S = fileversioninfo. getversioninfo ([Assembly]. getexecutingassembly. Location). legaltrademarks)

VB6:
App. logmode
App. logpath
VB. NET:
No direct replacement; see the EventLog object

VB6:
I = app. Major
VB. NET:
Imports system. Diagnostics
Imports system. Reflection
I = fileversioninfo. getversioninfo ([Assembly]. getexecutingassembly. Location). filemajorpart)

VB6:
I = app. Minor
VB. NET:
Imports system. Diagnostics
Imports system. Reflection
I = fileversioninfo. getversioninfo ([Assembly]. getexecutingassembly. Location). fileminorpart)

VB6:
App. nonmodalallowed
VB. NET:
No replacement

VB6:
App. olerequestpendingmsgtext
App. olerequestpendingmsgtitle
App. olerequestpendingtimeout
App. oleserverbusymsgtext
App. oleserverbusymsgtitle
App. oleserverbusyraiseerror
App. oleserverbusytimeout
VB. NET:
No replacement; OLE Automation not supported

VB6:
S = app. Path
VB. NET:
S = system. Windows. Forms. application. startuppath
Or
Imports system. Reflection
With new system. Io. fileinfo ([Assembly]. getexecutingassembly. Location)
S =. fullname. substring (0,. fullname. Length-. Name. Length-1)
End
Note: This will return the path with no trailing backslash even if the application is in the root directory. the VB 6.0 app. path Method return encoded Ded the trailing backslash when the executable was in a root directory.

VB6:
B = app. previnstance
VB. NET:
Imports system. Diagnostics
B = (ubound (process. getprocessesbyname (process. getcurrentprocess. processname)> 0)

VB6:
S = app. productname
VB. NET:
Imports system. Diagnostics
Imports system. Reflection
S = fileversioninfo. getversioninfo ([Assembly]. getexecutingassembly. Location). productname)

VB6:
App. retainedproject
VB. NET:
No replacement; State not supported

VB6:
I = app. Revision
VB. NET:
Imports system. Diagnostics
Imports system. Reflection
I = fileversioninfo. getversioninfo ([Assembly]. getexecutingassembly. Location). filebuildpart)
And/or:
I = fileversioninfo. getversioninfo ([Assembly]. getexecutingassembly. Location). fileprivatepart)

VB6:
App. startmode
VB. NET:
No direct replacement

VB6:
App. taskvisible
VB. NET:
No direct replacement

VB6:
App. threadid
VB. NET:
No direct replacement; see the system. Threading. thread object

VB6:
App. Title
VB. NET:
The text (Caption) of the top-level form. If there are no forms then the process does not appear in task manager.

VB6:
App. unattendedapp
VB. NET:
No direct replacement

Methods:

VB6:
App. startlogging
App. logevent
VB. NET:
No direct replacement; see the EventLog object

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.