If then else - control statement, Visual Basic Programming

Assignment Help:

If Then Else:

The control statement If Then Else is used for computing a condition and taking the action based on the condition. If the condition is true then the section will execute or else block will execute.

If .. Then...Else:

If condition Then

Block of VB Statements

Else

Block of VB Statements

End If

To use If then Else construct you can place a button and the text box on the form as given in the figure. Now Run the project and enter the value in the text box and then click the button. The event handler given below executes and if the value entered surpasses 50 it displays passes, or else it displays fail.

Private Sub Command1_Click()

If Val(Text1.Text) > 50 Then

Form1.Print "pass"

Else

Form1.Print "fail"

End If

End Sub

2370_if then else.png

Figure: Illustration of If then Else


Related Discussions:- If then else - control statement

Hierarchy of operation, what are the functions and the importance of hierar...

what are the functions and the importance of hierarchy operators

Question, #question.algorithemtofindwhetheragivennumberisprime/not.

#question.algorithemtofindwhetheragivennumberisprime/not.

Visual processing - visual interface design, Visual Processing: Our mi...

Visual Processing: Our mind groups the things into patterns and this allows us to process the visual information. Understanding and applying how the human mind processes the v

Project on VB6.0, I need a VB6 software for making a soccerboard for 10 tea...

I need a VB6 software for making a soccerboard for 10 teams & automatically generate their fixtures

#simple interest using pseudocode and flowcharts, simple interest using flo...

simple interest using flowchart and psuedocode using the formular s= x + nrx

Match Game, I would like someone to look at my code and tell me why it''s n...

I would like someone to look at my code and tell me why it''s not working

Validation controls, Describe different validation controls of VB.net?

Describe different validation controls of VB.net?

Drawing, #questiontypes of lines and how to draw

#questiontypes of lines and how to draw

Indexing - visual basic, Indexing: In libraries, the card catalog is t...

Indexing: In libraries, the card catalog is the index. The three indices are used in the library. The Author, Subject and title are the 3 indices. Each index is relative. The

Sdk programming, SDK PROGRAMMING The SDK programming is a developing Wi...

SDK PROGRAMMING The SDK programming is a developing Win 32 based programs using the Win 32 API that directly interact with the hardware. Therefore the execution of the SDK prog

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd