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
Variables must always be described with the smallest scope possible. VBScript variables can have the given scope. Scope Where Variable is Declared

INTRODUCTION TO CONTROLS AND TOOLBARS The Visual Basic programming is an event driven programming. In the form objects the termed controls are placed. We can put the properties

FILES IN A VB PROJECT The project file has the.vbp extension. The form in which we draw has the .frm extension; .mod denotes the module file; .cls denotes the class file; .res


Methods: VBScript Err Object Clear Method Clears every property settings. Raise Method Generate a run-time error.

I was looking solution for assignment named Alamo Tour

You are asked to create the LOTO game customized according to the following constraints: 1. Create a grid containing 20 numbers (20 buttons: button1, button2, …button20) 2. When t

Case: Design a web page that contains the VBScript utilized for calculating subtotals, taxes, discounts & totals as well as code utilized to validate use

i need to do my final project for my last year bsc honours degree in Business Information systems. I need to develop a system which is operational for hotel management system. th

Question 1 Create a VB application to make the text bold, italic, underlined and also color the text (using checkbox, option button, textbox controls) Question 2 Create a