Professional Documents
Culture Documents
Data
: ) - - ( :
--
- RAM
-
-
Data Type
- ) ( ) (byte
- )) ) (byte
((
/
: /
Data Type
( Decimal Double
) ( Char String
Data Types
. ) ( Bytes
Integer ) ( bytes
. ) (Range )Byte (
. ) ( Precision ) (
:
) -
- (
: /
Byte
Short
Integer
Long
single
double
decimal
char
boolean
Object
date
string
// //
byte
single
double :
decimal :
- char
string
: /
) ( ) ( byte
- F4
- Text
) ( Data type
. Property Property
. Data Type Property AS
) (Text) ( String
) AutoSize ( Boolean
) Width ( Integer
: /
Value :
. Text
. Visible
. ForeColor
. Font
.
. Variable Properties
properties
- ) (
-
- .
-:
. Dim
Dim AS Data Type
) ( Data Type
/
As
-:
-:
. Dim
. ) = ( ) (
False
Dim
Dim ChildWeight , Population ,sum as Integer
Dim Population as Integer = 123, Name as String = "Ahmed", Price as Decimal = 123.5
) ( vb.net
. ) ( A-Z a-z ) _ .(underscore
. ) (. )(
)!( )? ( . ,+,-,^,*,
. _ underscore .
. ))).
Sum ((( Average
FirstName
Ahmed2000
_Mahmoud
Spent_mony
2ndWorldWar
Spent.Money
Birth Day
Double VB
-Ali
: /
Data Type
Data Type :
. Data Type
.
Boolean
true false
Object
String
- (
-
Short
Integer
Double
- +
Double
Decimal
Long
Long
Single
)1-1 ) ( Variables
Form
: /
1- 1
Data Type
String
Date
Boolean
Integer
U_Name
U_B_D
U_Gender
U_C_F
Assignment
-
- ) = (
Varible
Varible
Property
Property
Expression
: /
-:
. "
. "
. "
.
"
"
"
.
Assignment
Name = Label1.Text
Name String Text Label1
: /
Variables .
= x=x+1
) (x ) ( x
) ( x) ( 5 ) ( x) ( 5+1 ) ( 6
Variables
Variables
U_Name
U_B_D
U_Gender
U_C_F
Properties Controls
Name
TextBox1
TextBox2
RadioButton1
TextBox3
Text
Text
Checked
Text
: /
Checked RadioButton1 If
Checked True U_Gender True
U_GenderFalse
TextBox1.Text
String
U_Name
String
TextBox2.Text
String
U_B_D
Date
TextBox3.Text
String
U_C_F
Integer
. Variables
. Variable
Property
Variables
. ) = (
Price =50
. ) = (
.
Variables
Label
False
AutoSize
Size,Location
FixedSingle
BorderStyle
: /
_& Me.Label5.Text = U_Name & vbCrLf & U_B_D & vbCrLf & U_gender
vbCrLf & U_C_F
:
- Text Label 5
) = (
- ) & ( & vbCrLf
- ) ( ) & ( .
- vbCrLf
- ) _ ( Code
Code
- Me Form.
/
: /
) (Code
- ) ( Debug ) . ( Start Debugging
- ) ( Start icon .
- ) ( F5 ) ( .
Label 5
- Code Compiler
: /
Constants
- Data Type
- ) Constant (
Const Constant As Data Type =
- pi Single 22 / 7 .
Const pi As Single = 22 / 7
" "
# #
- F7
- View Code
- D- Click
- View Code
/
: /
Constants
-
Form
- Code window F7
Click Button1,Button2
R2
2R
R
22/7
:
Code Button1_Click
Button2_Click Label2 .
Button1_Click Code :
. Radius Single
. pi Single 22/7
. TextBox1.TextRadius
. pi * Radius ^ 2Label2.Text
Code
F5 Start Debugging
" "
: /
) (5 ) (Variables ) ( Constants
Radius = TextBox1.Text
Label2.Text = pi * Radius * 2
pi
- Button 2
- Radius pi Button1_Click
- Radius pi
Button1_Click
Radius pi Button2_Click
: /
Radius pi Form3
Form3
: /
" "
- ) : (Local Variables
Button1_Click
Button2_Click
Form3
Errors
Code
Syntax Errors
Logic Error
Runtime Error
- Syntax Errors
Code :
Din x As Single
x Dim
Const x As Single
x
IDE .
- Logic Error
Expressions
:
Dim Radius As Single
Const x As Single = 22 / 7
Radius = TextBox1.Text
Label2.Text = x * Radius ^ 2
/
: /
Code
.
Logic Error
-
- Logic Error
- Runtime Error
Code Asignment
:
. Compiler
Type
- Code
Click" "
255
Runtime Variables :
/
: /
:
- Start Debugging F5
" "
TextBox
"" Byte
Stop Debugging
Start Debugging
F5 ) (
TextBox
Stop Debugging
Start Debugging
F5 TextBox
255
: /
Runtime Error
Visual Basic .NET Try/ Catch
Try / Catch
. VB . net
. Try / Catch
-:
Try
Code
Catch ex As Exception
Code
EndTry
Catch
. Try Catch
Try
: /
Controls Properties
) (
vb.net
mod
vb.net
Label2.Text = x * Radius * 2
5+3*2
) ( 11 (5+3) *2
) ( 1 6
/
: /
. ) (
.
. ) (
. ) (
) (
:
Expression
-:
-:
Y=3
Z=4
)X*(Y+1
Y^ X * X + Z *3
X=2
)A
)B
(A
-
) 2* ( 3 + 1
-
)2*(4
- ) ( 8
(B
.
.
3^ 2 * 2 + 4 * 3
9*2+4*3
. 18 + 4 * 3
. 18 + 12
.
30
: /
: /
: /
: /
: /
: /