You are on page 1of 33

Unit 1

Overview of GUI Programming


Topics
• Introduction to .NET framework components:-
(i)CLR
(ii)MSIL
(iii)JIT
• Exploring VB.Net IDE
• System Namespace in VB.Net
• Events and Events Handling
• What do you mean by Programming language?

 A programming language is a special language that


programmers use to communicate with the computers to
develop an application or software.

 Ex :- Java, C++,C, PHP, ASP .NET, VB.NET


VB.NET
• VB.NET is a combination of two words

VB .NET

Visual Basics
Using .NET
Programming
Framework
Language
VB(Visual Basics)
• It is a object oriented programming language designed by
Microsoft in May 1991.

• Alan Cooper is widely recognized as the father of Visual


Basics.

• With the word basic being in the name of the language, you
can already see that this is a language for beginners.
(Because the syntax of this language is easy and you will not
find yourself writing hundreds of lines of code.)
•VB is designed to make software development easy and
efficient.

•It is use to create console,windows,web applications( Because


the tools require to create this application are available in this
language).

•VB is not a case sensitive like other languages such as C++ and
Java.

•Visual basic provides a graphical user interface that allows the


developer drag and drop objects into the program as well as
manually write program code.
1.Introduction to .NET framework
• .NET is a framework/Platform which is required to run different languages
such as VB,C++,J#, C# ,JavaScript on computer.

• .NET is not a language. It is a platform for Application developer

• The first version of .NET framework was released in the year 2002(Version
was 1.0)

• Total 96+ languages are available that we can use with .NET framework.

• Developers can choose from a variety of programming languages available


on the .NET platform. The most common ones are VB.Net and C#.
Features of .NET framework
• Interoperability - The .NET framework provides a lot of
backward support. Suppose if you had an application built on an
older version of the .NET framework, say 2.0. And if you tried to run
the same application on a machine which had the higher version of
the .NET framework, say 3.5. The application would still work.

• Portability-.NET framework not only supports to Microsoft


windows but it is designed in such way that it can support any other
platform with any other operating system.

• Security - The .NET Framework has a good security mechanism.


• Memory management - The .NET framework has all the capability to
see those resources, which are not used by a running program. It would then
release those resources accordingly. This is done via a program called the
"Garbage Collector" which runs as part of the .NET framework. The garbage
collector runs at regular intervals and keeps on checking which system
resources are not utilized, and frees them accordingly.

• Languages-It is a framework that supports multiple languages( Like VB,


C#, C++, ASP.NET, JavaScript)

• It has IDE(Integrated Development Environment)-


Visual studio
(to execute and develop a program)

• It provides GUI(Graphical User Interface)


Advantages of .NET framework
1.Good design.

2.It supports object Oriented Programming.

3.It has language compatibility.

4.Robust and Secure

5.Supports window based application.

6.Supports web services.


What can you do with vb.net
• Windows applications
• Console applications
• Web applications
• Database applications
• Mobile devices applications
Compilation Process
Any other
VB.NET C#
language

Language
VB Compiler C# Compiler
specific compiler

MSIL OR IL
(Microsoft Intermediate language or Intermediate Language)

CLR(Common
JIT Language runtime)

Native Code
• Language:- Language which you are currently working on.

• Compiler:- Language specific Compiler.


(to convert source code into machine code i.e. MSIL OR IL)

• IL(Intermediate Language)Code or MSIL code:-

When you compile .NET program using any .NET compliant language, it
does not get converted into the executable binary code but to an
intermediate code called MSIL or IL,understandable by CLR.

MSIL is OS independent code.(It is half compiled code)

When the program needs to be executed, this MSIL or IL code is converted


to binary executable code(Native Code).
• CLR(Common Language Runtime):-
CLR represents runtime environment of .NET which is responsible for
executing .NET program.

CLR resides above the OS and handles the execution of all .NET
applications. Programs don’t directly communicate with the OS but go
through the CLR

CLR SERVICES:-
1)IL To Native code
2)Exception Handling
3)Garbage Collection
• JIT(Just In Time Compiler)-

JIT converts the MSIL code to native code which is OS dependent.

Rather than using time and memory to convert all the MSIL code to native
code, it converts the MSIL as it is needed during execution.
(EX- when a function is called, the IL of the function’s body is converted into
native code just in time.)

if some IL code is converted into native code, then the next time it is
needed, the CLR reuses the same i.e. already compiled copy without re-
compiling.

This native code is specific to the computer environment that the JIT
compiler runs on.
Three types of JIT Compiler
1)Pre-JIT Compiler-
All the source code is compiled into the machine code at the same time in a
single compilation cycle using pre-JIT compiler. This compilation process is
performed at application deployment time.

2)Econo JIT Compiler-


The source code methods that are required at run time are compiled into
machine code by the Econo JIT compiler. After these methods are not
required anymore, they are removed.

3)Normal JIT Compiler-


The source code methods that are required at run time are compiled into
machine code by Normal JIT compiler after that they are stored in Cache
and used whenever they are called again.
Compilation

Language
Source Code MSIL/IL
Compiler

CLR
Execution

Native Code JIT Compiler


2.Exploring VB.Net IDE

• Solution Explorer:- The files, Modules , forms or recourses


which you are using in your project are shown in Solution
Explorer.

• Data Source:- If you are using any database in your project, it


will be shown here.

• Toolbox:- It consist of common controls that you will need to


create an application.( Just drag and drop from variety of
controls available in Toolbox.)
• Properties:- It will show different properties.( Ex:- font , size,
colour, name etc.) of the tools you are using. You can change
the property of tool according to your need.

• Form:- Form is the window where you will design your


application.
– Designing part will be done in form.
– You can adjust size of form according to your need.

• Coding Part:- Double click on the tool for which you want to
write code. ( Shortcut-Press F7 to open code part)
• Run:- Click on start button in Toolbar to run program or
(Shortcut to run program- F5 for Windows application and
ctrl+ F5 For console application)
VB.Net IDE

• IDE( Integrated Development Environment)


Visual Studio 2012 Express

• Steps to start
Open Visual Studio New Project
Templates( Visual Basics) Windows form
application/ Console Application Name of
project Location to save your project Ok
3.System Namespace
• Namespace is the logical grouping of classes and interfaces
based on their functionalities and usability to which they
should belong.

• In the namespace all the declared items are always


uniquely named.

• Due to this we can avoid naming conflicts.

• Same name can be given to different classes which belong


to different namespace.
• Vb.NET provides following System Namespace:-

– System
– System. Collection
– System.IO
– System. Text
– System. Data
– System. Drawing
– System. Threading
– System. Windows. Form
– System. Xml
3.Events and Event Handling
• Events are basically the actions performed by the user like
mouse click, key press Etc.

• Event driven programming is nothing but the computer


programming in which the flow of the program is determined
by the events.

• In an event driven programming we can execute a set of


program code when user fires events like mouse click, double
click or mouse move.
• In GUI event is an important aspect.
• There are mainly two types of events:-
– Mouse Event
– Keyboard Event
YO U
A N K
TH

You might also like