IF Then vb2010

Preview:

DESCRIPTION

Visual basic 2010 If Then Statement

Citation preview

Electroteam__@hotmail.com

Interesting

EducationElectro-Team

Visual Basic 2010

IF....Then Statement

IF  condition Then

VB expression

End IF

Operator Meaning

= Equal to

> More than

< Less Than

>= More than and equal

<= Less than and equal

<> Not Equal to

OR One side or other must be true

AND Both sides must be true

Xor One side or other must be true but not both

Not Negates truth

Conditional & Logical Operators

Open new project

Add above controls

F5

Edit Properties then press F5 to display output window

Steps to add new form to your project

Steps to add new form to your project

Back to Form1

Double click on button1

You can select any value for textbox.Here my value = xyz small letters.

Press F5 and writ your password (value) in the textbox, then press button1.

Close program from Stop button in IDE Toolbar

Add ListBox & PictureBox to Form2

Open project properties

Select Resources tab

We need to drag and drop image files here

Drag pics from local drive and drop it in VB resources window

Run Time

Selecting pic1 in ListBox will result this output

pic_one = image file name

Assignment

Images stretched to fit PictureBox dimensions

IF  condition ThenVB expression

ElseVB expression

End IF

IF....Then Else Statement

Back To Form1

IF....Then...ElseIF Statement

IF  condition ThenVB expression

ElseIF condition ThenVB expression

ElseVB expression

End IF

Produced by

Electro-Team

Electroteam__@hotmail.com

Recommended