You are on page 1of 24

:

:
!

:



!!
Start Page VS.Net .

:VB.NET
" " ! ..
" : "!! ..
" " !


( !!).

:
..
.

:Polymorphism
..! Properties Methods

Events .VB

:


! .. .VB.Net

:
.VB.NET
.
VB
VS.NET
Incompatibility

.

..VB6 !

VS.NET

) Integrated Development Environment (IDE

Windows Applications Web Applications Classes Custom



Visual Tools Application Interface

Controls

IDE
.

.

(
).

:

: ...
F1
VS.NET .

VS.NET




VS.NET !

VS.NET

!


.


..
Objects

!

Menu Designer


IDE

Menus Commands Submenus


Keyboard Properties Window ).

Mouse

Design Execute Debug.



:Start Page
VS.NET .
" "My Profile .. " "
Visual Basic Developer "" Profile

..
.

" At Startup " ..


VS.NET


:
:Show Start Page
.VS.NET
:Load Last Loaded Solution .VS.NET


" " :Show Open Project Dialog Box
.

VS.NET " "

" " :Show New Project Dialog Box


..

VS.NET " "

.

:Show Empty Environment .
VS.NET

" " "



".


.""Get Started




VS.NET


.

.VS.NET

.ASP.NET.
""Web Hosting

Form.
..

.
"" File " " ..New Project " "
.VB.NET
" " ..Windows Application VB.NET ..WindowsApplication1
.MyTestApplication


..
Pernamagy .

.
Project name Location

:
VB6 VB.NET
-1

.
-2 VB.NET ..

Hard Disk Operating System





..

.OK

:IDE

Form Designer .
.Design mode


Windows

Interface Components .
Default state Toolbars
.

..

"" View " " ..Toolbars



..
.

" " Layout ".Standard "





Dialog box
" Customize "

.. .. !

:Windows Form Designer


Controls .Runtime
Controls "" Windows Interface Buttons
Radio Buttons ..Lists.
Toolbox tab ..
Toolbox

.

Tabs
Control
.
: " " Windows
.Forms
" " ..Disabled

.


" " Disabled
Web Form " " .Web Forms
:
Double-click
.



..
.. ..
.

:
.


New Instance

..

..

.. ..

( ) " " Delete .


Properties window
.
"" View " " ..Properties Window
F4 .

:
:
.Menus Context Menu . Tool Bars .. TooTip ..
.
F12 .... ,F2 ,F1 Ctrl Shift ..Alt .

.Solution Explorer

:
TextBox .. "" .Properties
..
:

"" :Text
"" Text " : "
."TextBox1"
Text .

:

-1

.
-2 .. F1
Help Window
..
.

" " :BackColor


" " BackColor .. ..Ellipsis Button ..
Dialog box :
Custom Web .System

..

.

"" :Font
" .. Font " " .."+
.. ellipsis Button ..Font dialog box
.. 14 Verdana Points .Bold

" " :MultiLine


.. " " ..MultiLine
" " ..False " " ..True
Double-click .

" " :WordWrap


.

.. " " WordWrap


..True False .

"" :ScrollBars
.

"" ScrollBars .. :

None
Vertical
Horizontal
Both


.
.
.
.

Vertical Text .

:
Design time ! ..
..Runtime ..F5 Compiled
..
) Microsoft Intermediate Language (MSIL
.
.. ..

Ctrl+C .. Ctrl+V

..

..
Clipboard
.
"" Debug" " ..Stop Debugging
.

" " :CharacterCasing


" " ..CharacterCasing
:

Normal
Upper
Lower


.
.Capital
.Small

.
..
.
Prototype .

VB.NET

:
:Code Editor Window
" " :Event Handlers
:
:

:More User-Friendly

:
.

:
-1 WindowsApplication1
.. ( )
" read-only " ..
:
.. .. "" ..Properties .. " CheckBox Read-Only "" " .OK
.. . -2
.

Button ..
Windows-Application1 TextBox
.
.

:Code Editor Window


" " Event Handlers
..
.
.. :
:
_ Private Sub Button1_Click(ByVal sender As System.Object,

ByVal e As System.EventArgs) Handles Button1.Click

End Sub
" Sub Button1_Click "1 .
Horizontal
ScrollBaar VB.NET "_ " Underscore
VB.NET ..
.Syntax


-1 VB ..
( ";" C++ ) .. VB
.. " Line-continuation character
_" .. " " word wrap
.. ".":
-2
..

..

.. VS.NET Code Blocks
:
If x = 0 Then
:
End If
..
!

:" Form1.vb [Design] "1" "1


.Form1.vb

..

Code Editor .
ComboBoxes
ListBox ..TextBox :
-1 :Objects List .

-2 :Events List .

.
.
" Click Event "
.

" " :Event Handlers


Event Handler ..
..Button1_Click
.
.. "_" Underscore
.
..VB
"" Handles
.Button1.Click
VS.NET
.. :


_ Private Sub Button1_Click(ByVal sender As System.Object,
_ ByVal e As System.EventArgs) Handles Button1.Click,
Text1.DoubleClick

End Sub
.VB

"" Name

VB.NET Handles ..
.
..

.
..
CheckBox ....

:
.
:
-1 .
-2 .
-3 .


.. ..

.

.. :
-1 .
-2 " "Visual Basic :
-

" : ".

- " : ".
Algorithm
( )

.. .
Button1_Click " " :EvaluateLanguage
_ Private Sub EvaluateLanguage_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim Language As String

Language = TextBox1.Text
If Language = "Visual Basic" Then

)" "( MsgBox


Else
)" "( MsgBox
End If
End Sub
:
-1 :
. :Declaring a variable
..
RAM
.
Low Level
Hardware ..
.
High Level
.
Variable
..
.

String .. :
Dim Language As String
" " Dim VB Compiler
Language
.String
:
_ AS_ Dim
_ .. Language
..

.
VB Capital
.. language l
Small

VB .Language

_ .. Integer Long ..String

.
. :Assigning a value to a variable
Text .
Language = TextBox1.Text

-2 Language " .."Visual Basic If statement


:
If Language = "Visual Basic" Then
. True :
)" "( MsgBox
..
MsgBox VB

"" OK
.
Msg Message ..
.
" " Else
.End If
. Else :
)" "( MsgBox
.

:1
:
)" "( Call MsgBox
.

( 2 :)VB6
VB ..Call
.

:3
Blocks :
Procedure :)_( _ Sub
_
End Sub
Function :_ ) As_( _ Function
_
End Function
: Then If
[ ].
Then ElseIf
[ ].
[ ElseIf ].
Else
[ ].
End If
.

:
""Visual Basic
!
" "visual Basic v
!
..
Uppercase "."VISUAL BASIC

VB.NET String Class " " .ToUpper

:
VB.NET Objects Classes
..VB6 :
Language = String.
..String
Properties Methods ..String Class
.

.. :
Language = language.ToUpper
" "Language ToUpper
.. ..
:
..

Dim UpperCaseLanguage As String = language.ToUpper

" "VB .."VB.NET"


_ Private Sub EvaluateLanguage_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button1.Click
Dim language As String

language = TextBox1.Text
language = language.ToUpper
_ If language = "VISUAL BASIC" Or language = "VB" Or
language = "VB.NET" Then
)" "(MsgBox
Else
)" "(MsgBox
End If
End Sub
" Or Operator "
.
" And Operator " .
" "" " .. .
.
.. VB.NET
.
..
.. ..
..ComboBox .

:More User-Friendly
..WindowsApplication2 " Font "
Ellipsis Button ..
11 Comic Sans MS .. .
Toolbox ComboBox ..

.
" " Text .

:
..
.

.. "" Items
.. Collection ..
.

....

:
C++
C#
Java
Visual Basic
Cobol
.
.
Text " : " ..
.
.. .
..

.
.. .
.. :
_ Private Sub EvaluateLanguage_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim language As String

language = ComboBox1.Text

If language = "Visual Basic" Then


)" "(MsgBox
Else
)" "(MsgBox
End If
End Sub
" " ..
..
.
.. ".Load Event "
.. ..

:
_ Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.SelectedIndex = 3
End Sub
Text .. !
..
.

:Menus

:
:Environment Options
Menus

:
"" :File Menu
"" :Edit Menu
"" :View Menu
"" :Project Menu
"" :Build Menu
"" :Debug Menu
"" :Data Menu
"" :Format Menu
"" :Tools Menu
"" :Window Menu
" ()" :Help Menu

:
Edit File
Commands .Submenus
Visible Enabled
.. "" Data Menu
.
.

"" :File Menu



.

"" :Edit Menu


..
:

"" :Advanced
.. :

" " :View White Space


..
.

" " :Word Wrap



"_ " .Underscore
..

" / " :Comment Selection / Uncomment Selection


.. ..
..
" ' " " "Rem: ..:
.. '
Rem:

..

.
.. " /
" .. .. !

" " :IntelliSense Submenu


..
.
:

" " :List Members



Language Button1 TextBox1 ". ".

:



.. .
Members
.
.


..
.
"""
.. :
= TextBox1.TextAlign
:
HorizontalAlignment.Center
HorizontalAlignment.Right
HorizontalAlignment.Left
.
Esc .

" " :Parameter Info


( )
( ) ..
..Declaration .

" " :Quick Info


.. Parameters
".",
) (Arguments

VB4 :
.
:

.

VS.NET
" ", . ....
)( DateDiff
.

" " :Complete Word


+ Ctrl ..

.
: " "TextB + Ctrl

You might also like