Skip to main content

Lesson 1

What is Visual Basic 2015?
Visual Basic 2015 is an object-oriented programming language designed by
Microsoft and implemented on the .NET Framework. It is a version of
Visual Basic, introduced by Microsoft in 2015. It includes many new features, particularly for building mobile and web applications. 
Visual Basic code can be written in any text editor (such as Notepad). However, most of the time programmers use Visual Studio 2015 Integrated Development Framework, which is a software from Microsoft that enables you to write, test, run, and debug your code in a nice GUI environment. Below is the picture of the Visual Studio 2015 IDE we will be using throughout this course:


What is .NET Framework?
.NET Framework is a software framework developed by Microsoft that runs
primarily on Microsoft Windows. You can think of it as is a platform that
provides tools and libraries you need to build and run networked application
and web services.
.NET Framework consists of two parts:
  1. The Common Language Runtime (CLR) - the run time environment of the .NET Framework. It provides a virtual machine-like sandbox in which applications run and supplies services such as such as memory and exception management, debugging and profiling, and security.
  2. The .NET Framework Class Library (FCL) - a huge collection of language-independent classes that are arranged into a logical grouping, according to their functionality and usability. Some of the services provided by FCL include accessing system services, interaction with databases, establishing network connections, and much more.
Install Visual Studio 2015
Before you start programming, you will need to download and install Visual Studio 2015, which is a development environment where you will write your code. 
If you need where and how to download visual studio 2015, get in touch on email: qurtiss@gmail.com
Putting the details here may cause the link to be removed and the software made unavailable.
The installation is pretty much straightforward and requires you to specify only a few things. First, you need to choose where to install the program and the type of the installation. I recommend that you leave all the default options and click the Install button. The installation process should then start. 
The installation could take quite some time, depending on the speed of your
Internet connection. After completing the installation process, you might see an
option to restart your computer to complete the installation process. If that is
the case, press the Restart Now button to restart your computer.

Getting to know the IDE
Visual Studio 2015 comes with lots of new enhancements and features. Some of these features widely enhance the productivity of application development. Let's get our hands dirty and dive into the Visual Studio IDE features and components to help you get started with using Visual Basic.The following image shows the Visual Studio 2015 IDE with an open project:


Visual Studio IDE has 7 main parts:
  1. Menu and toolbar - the Menu contains a group of related commands that, when selected, cause the Visual Studio to perform specific actions. (e.g. open a window, save a project, exit a program). For example, new projects are created by selecting File > New > Project.
  2. Toolbox window - the Toolbox window contains all objects you can use to build your application's GUI. The control objects in the Toolbox are organized in various tabs. The Common Controls tab contains the icons for the most common Windows controls, while the All Windows Controls tab contains all the controls you can place on your form.
  3. Solution Explorer - once you open up a project, the Solution Explorer shows the main files of your application. You can use it to quickly move from one part of the application to the other. 
  4. Properties window - this window allows you to change the control's properties at a design time environment.
  5. Working area - the central part of the IDE is your working area, where you design the user interface.
  6. Code window - the place where you write your code.
  7. Debug window - Visual Studio also includes a debugger, so you can runyour applications in development time, without having to make executables or distribution packages.
Writing your first .NET code
Now that we've learned a little bit about the IDE, let's use it to write our first program. Start your Visual Studio 2015 and you should get a screen like this:
From the File menu select New Project. The following dialog box should
appear as below:
If not already selected, select Visual Basic under Templates. Choose Windows Forms Application and change the default project name to Hello world project. We've selected the Windows Forms Application type because this type provides us with a form in which we can easily add user interface elements, such as buttons, labels, menus, and other GUI elements.
Click the OK button and the Visual Basic design environment will open. It
should look something like this:

As you can see from the picture above, we've got a screen similar to the one we've described in the previous section. In the middle of the screen is the Design area with our blank form. Here we can add UI elements from the toolbox on the left. So let's add some elements to our form.
We will start our example by adding a button to your new form. Locate the Button tool from the toolbox and double-click on it. The button should be added to the top left position of your form:



In the bottom right corner you should see the Properties window that contains various button settings. Find and change the following properties of Button1 to:
Name: btnHelloWorld
Text: Display message

Now, double click your new Display message button, and add the following code:
MessageBox.Show("Hello World")
To run the program, do one of the following:
From the menu bar, click Debug OR
From the drop down menu, click Start Debugging OR
Press the F5 key on your keyboard
You have now created your first program! When executed, it should look
something like this:
Edit

Next, we shall look at the concepts of visual basic 2015 including
  • Variables and their naming conventions
  • Strings and Dates
  • Using comments in visual basic code

Do you want the book introduction to visual basic 2015? Just donate through the button below and inform me to send u the book.

Comments

Post a Comment