Monday 16 March 2015

How Insert Date and Time in windows Form?


Hi friends this is our first program so we start with date and time.

The very first thing is that you have to take the new form, I was explained in last tutorial that how to take new form. It will look like below image.




After that follow the below steps
Step 1: Take the 2 Labels from Toolbox (Label is used to display anything in form).
Step 2: Rename the first label as  ”lbDate” which we use to display Date
             To rename Label go to Property Box right side of the window search for Design part.
In “Design” search Name type name of label.
You can change other properties like fonts, font color, font style etc. from property
Step 3:  Double click on form.

After double click code window will be open.  It will look like below image.


Write there below code. (Friend I want to suggest you that don’t copy and paste the code, please write it so that you canremember it for future).

lbDate.Text = Format(Now, "dd-M-yyyy")'To display date lbTime.Text = Format(Now, "hh:mm:sstt")‘To display time 
When we write the above code, date and time will be shown. But time will be static here it will show only time when the application will execute. To show continues clock we need to execute the code “lbTime.Text = Format(Now, "hh:mm:sstt")” every second. For this we need Timer tool.

For timer go to the design tab, then search for Component part, in component part there will be Timer, double click on it.


In above image you can see it. Just like the above image see right side of the window in property box, you can see the Enable property make it “True” and in Interval property make it “1000” .
You can also change the name of Timer in Name property.
After that double click on timer and copy paste the code 

lbTime.Text = Format(Now, "hh:mm:sstt")”.

After completing the above all steps, Run the program by clicking on Start button.


There are different formats for different date and time given below.
lbDate.Text = Format(Now, "dddd")         ‘To display the full name of day like “Monday”
lbDate.Text = Format(Now, "ddd")           ‘To display short day name like “Mon”
lbDate.Text = Format(Now, "MMMM")    ‘To display full name of month like “March”
lbDate.Text = Format(Now, "MMM")       ‘To display short name of month like “Mar”
lbDate.Text = Format(Now, "MM")            ‘To display month in no. format like “03”
lbTime.Text = Format(Now, "hh:mm:sstt")‘To display time in 12 hr format
lbTime.Text = Format(Now, "HH:mm:sstt")‘To display time in 24 hr format

Note: We can also display the Date and time on Textbox, masktext box or on any other text display component.
Read More

Wednesday 11 March 2015

Introduction to VB.Net



Hi, guys Welcome Back
Here we learn VB.Net so let’s start,

Introduction

Visual Basic is the most popular programming tool available today. And it's also no secret that there have been massive changes in the latest version, VB.Net. The VB.Net is a programming tool which used to develop the windows application and software. Today almost every windows software is developed using VB.Net.  So what is the VB?  VB is Visual basic a Programming Tool and VB.Net is advance version of VB. “.Net” is a framework which we discuss letter.
Putting VB.NET to the work
Have you you VB.Net? if not don’t worry you can download here start your Visual Studio it will look like below image.
Follow following steps 

Click on "Start button"
Click on "All Program"
find "Visual Studio" then click on it.


I'm not going to go into the details here, because we'll cover them later tutorial —right now, let's just have a little fun.

There are three types of applications in Visual Basic, "Windows form Applicaton",  "Web Forms Application" and "Console Applications". Here we learn about Windows form Application.

How to start programming?

To start the Programming follow the following steps,
  • v  Click one the File Menu
  • v  Click on the New
  • v  Then Click on Project for windows application or website depending on what you want to develop.

    Here we will discuss Windows Application

So select Project or Press (Ctrl + Shift + N) all together it will open

New Project dialog box

It will look like below image.


Now Click on Templates just right side column of New Project dialog box.

In Center column click on "Windows Form Application"

At the bottom one text box is there labeled as "Name" type your project name.

In Location field choose folder or location where you want to store that project with the help of Browse button at right side.

At Final Stage Click on  "OK".





Read More

About Me

Popular Posts

Designed ByBlogger Templates