. Net

Source: Internet
Author: User
Tags arithmetic operators goto logical operators print format

VB6.0 and vb.net function tables

Vb. NET function table

vb and VB vb vb vb vb vb vb vb

Object Browser View System internal constants

Form1.backcolor = Vbblue

Form1.backcolor = QBColor (0)

Vbkeyup Vbkeydown Vbkeyleft vbkeyright represents the key code around the keyboard

Custom constant Const PI = 3.14

Variable Dim qq As String equivalent to Dim qq $

Implicitly declaring variables without dim directly using i=i+1

The colon connects two lines of code into one line

Spaces underline one line of code into two lines

Arithmetic operators:

-Take negative

& Connection

Relational operators:

Like comparison style

Is comparison object variable

Logical operators:

Not (1>4)

And OR

XOR Exclusive OR

Eqv equivalence

Imp implication

Input and output:

Print "Hello" is equivalent to Form1.print "Hello" output on Form

Picture1.Print "" Output on picture frame

Debug.Print "" Output in Immediate window

Printer.print "" With printer output

A print is the output of a blank line

Print A, b the middle of the divider big point

Print A; B

Print A:tab (8): b tab (8) Means 8 empty Spc (8) for 8 spaces

space$ (5) is available in a string, representing 5 spaces

Format specifier

Format $ (string, format) str$ () function almost

Print format$ (99, "0000") output four digits

Print format$ (12.567, "#.###") output 12.57

Print format$ (12.567, "000.0000") output 012.567

Print format$ (12345, "#,#") output 12,345

Print format$ (12345.123, "#,#.##") output 12,345.12

Print format$ (12345, "000000,0") output 0,012,345

Print format$ (12.567, "$ 000.0000") output $012.567

CLS Clears form text

Move 2000,2500,2600,2300

CurrentX = 200

CurrentY = 300

Print ""

Dim A As String

A = "FDD"

CurrentX = (Scalewidth-textwidth (a))/2

CurrentY = (Scalewidth-textheight (a))/2

Print a

Dim A As String

A = InputBox ("Please enter your name", "Prompt", "hello", 3000,5000)

Print "Your name is:" & A

biaoti$ = "Student Information Registration"

b$ = InputBox ("Please enter name", Biaoti)

MsgBox "Welcome" &chr$ (12)

MsgBox "Welcome" &vbcrlf function

Dim A As String

A = MsgBox ("Are you sure you want to quit the program?", 1+32) ' 1 is used to display a "OK" and "Cancel" button, 32 to display the system problem icon

If a = 1 Then

End

Else

Print "You did not quit this program"

End If

Text1.fontbold = Not text1.fontbold ' Take reverse operation

Form. Show ' Me.Show

Text1. SetFocus

For Next loop:

Dim i As Integer

For i = 1 to 10

Print I

Next I

When the loop:

While a <> ...

...

Wend

Do loops: ' While until can be placed behind loops

Do While condition

...

Loop

Do Until conditions

...

Loop

Export statement:

Private Sub Form_Click ()

Dim i,num

Todo

For i = 1 to 10

num = Int (rnd*10)

Print num

Select Case num

Case 5:exit for

Case 8:exit Do

Case 9:exit Sub

End Select

Next I

Print "Exit for"

Loop

Print "Exit Do"

End Sub

Goto Statement on Goto statement

100

...

If.. Then goto 100

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.