If then vb2010

30
Electro team Electro-Team Interesting Education

Transcript of If then vb2010

Electro team

Electro-TeamInteresting Education

IF....Then IF....Then Statement Statement

IFIF  condition ThenThen

VB expression

End IFEnd 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

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