Creating 1st program using Visual Basic 6 and Visual Basic 2015

Asked By 30 points N/A Posted on -
qa-featured

Can you help me with my home studies about VB 6 and VB 2015? In creating my first program what are the things that I need to remember? What are the objects that I’m going to use to make it run properly? What do you mean by .exe? How to create it? Can you show me how to create and run simple program with VB6 and VB 2015? What is the functions of each tool in tool box? Thank you very much and have a nice day!

SHARE
Answered By 0 points N/A #165302

Creating 1st program using Visual Basic 6 and Visual Basic 2015

qa-featured

Hello Marie!

In creating any program in any programming languages always remember the following.

1.  Analyze the problem.

2.  Design the output window

3.  Write the commands or codes

4.  Test the program

5.  Debug the program

Here is my sample program for you.

1.  You need to have a label with text property set to “Our current time now:”

2.  1 text box and set the name property to “strTime”.

3.  1 Timer Control and the enabled property set to “True”, interval “100”.

4.  1 Form off course

Her are the codes.

Public Class Form1

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

        strTime.Text = Format(Now, "h:mm:ss tt")

    End Sub

End Class

Explanation: see on line number three, “strTime.Text = Format(Now, “h:mm:ss tt”)

The current time will be called every after 1 second because of Timer interval set to 100. We used the functions “Now” to call the current time and date only, we chose to display only the time. Formatting it according to the specifications after the function Now.

Related Questions