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
simple interest using flowchart and psuedocode using the formular s= x + nrx

Fixed length strings: The Fixed length strings are declared by identifying the size of the string. For illustration to give a length of 20 for the string place, the declarati

what are the things that information system can do and their limitations?

Message Routing: The system posts the messages to a first-in, first-out queue known as the message queue or it sends the messages directly to a window procedure. The Messages

Use of WM_SIZE Message: Whenever the WM_SIZE message is handled and the graphical objects on the output window will also change consequently to the output window. The functi

Displaying a file With Scrolling: To display a file with the scrolling option allows the steps as shown below: 1. Generate a SDI application. 2. In the Step 6 of the App

Ask question #Minimum 10Public Class Form1 ''=============================================== ''Date: June 24, 2014 ''Author: Xochitl Nisbet ''Purpose: Convert Celsi

INTRODUCTION TO DATABASE APPLICATIONS   In this section, we define a dialog and tab order that is the order in which the controls will be navigated during the execution. The D

Creating an application that will calculate the cost of a car rental based on the number of days that the car is rented. the cost of the car rental includes the cost of the car its

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