Aim - control statement, Visual Basic Programming

Aim:

To exhibit what is the day when the second command button is clicked and to clear the screen when the first command button is clicked. The functioning of this program is given in figure:

1) Handle the click event for the first command button.

2) Handle the click event for the second command button.

3) The Cls method clears the form.

4) Type the below coding in the first command button event handler.

Private Sub Command1_Click()

Form2.Cls

End Sub

5) Type the below coding in the second command button event handler.

Private Sub Command2_Click()

Select Case Weekday(Now)

Case vbSunday

Form2.Print "sunday"

Case vbMonday

Form2.Print "Monday"

Case vbTuesday

Form2.Print "Tuesday"

Case vbWednesday

Form2.Print "Wednesday"

Case vbThursday

Form2.Print "Thursday"

Case vbFriday

Form2.Print "Friday"

Case vbSaturday

Form2.Print "Saturday"

End Select

End Sub

1339_command buttons.png

Figure: The Resultant of clicking the command button and caption week day

The function Weekday returns the present day. If the day is Sunday vbSunday would be returned. And hence, the corresponding block would execute. Therefore the Sunday would be displayed on the screen. The Select Case and End Select denote the block.

Posted Date: 10/9/2012 8:23:12 AM | Location : United States







Related Discussions:- Aim - control statement, Assignment Help, Ask Question on Aim - control statement, Get Answer, Expert's Help, Aim - control statement Discussions

Write discussion on Aim - control statement
Your posts are moderated
Related Questions
MESSAGE LOOP   The message loop is the code in the Win 32 based application. It retrieves messages from the application's message queue and passes these to the related window

STORAGE AND RETRIEVAL SYSTEMS   The storage system is a depository. It is a physical container and gives mechanisms to put in the depository and take them back. The retrieval

i need code for assignment problem of operational research in vb

Dialog Based Application: The application which app wizard generates is based on the dialog template resource.

You can employ For...Next statements to run a block of statements a specific number of times. For loops, employ a counter variable whose value is increased or decreased with each r

i have a database i want mange it network and i want write it with vb.net so how i can do this

Write a program that permits the user to order a product from inventory. The user selects the product and enters the quantity. If there is sufficient quantity on hand of the produc

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

Visual Interface  Based On Visual Patterns: The visual user interface should create recognizable patterns and text will be used for differentiating the objects with similar pa

A triangle is equilateral if all three sides are equal, isosceles if any two (but no more than two) sides are equal, and scalene if no two sides are equal. A triangle will be input