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
Steps for Creating A MDI Form: 1. Build a new form and set IsMdiContainer property to true. 2. Build a child form class to add to the form. 3. Now Right click the proj

You can employ the SCRIPT element to add VBScript code to an HTML page. The SCRIPT Tag VBScript code is written inside paired SCRIPT tags. For instance, a process to test

INTRODUCTION TO VB: The Windows programming is an event driven programming. The VB uses the Hungarian Notation for naming the variables. It deals with new data types like HWND,

THE MFC CLASSES The CDocument, CWinAppCFrameWnd and CView are derived from the CObject and they give the majority of the structure and functionality.

want a visual basic code on Hungarian method

Associating Images to Toolbars: 1. Add an Image list to your form from the tool box. 2. Pick the custom property of the image list. 3. Click the images tab. 4. Select

I am a beginner in Visual basic 2012 and making a data management programme with visual basic 2012 as front end and MySql as back end. I want to filter data grid view table with Li

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

The objective of this unit is to describe the basics of VBScript. After completing this unit, you will be capable to write code for Web pages via VBScript. You will be able to unde

SDI Application The SDI application uses the main frame window to exhibit a document. Only one document can be opened at a particular time.