You are on page 1of 70

:

) (

. . . . .
.

.

.
:
www.powerearth.4t.com

powerearth4t@Yahoo.com

)( )( .
.

.
.
.
" "
" "
" "
.

.
)---- (. . . . .
)-- - (. . . . .
.


IDE

)IDE(Integrated Development Environment

Solution
Explorer

Double Click



Events


*]Form1.vb[Design
*Form1.vb

F5
Run Toolbar

List Members
Methods&Properties&Events&Argument List
TextBox1. List

exe bin



Console Applications
Console Applications



Windows Applications

Dos Window

Output F5
)(console.readline

Output

Variables

Variables
Text & Numbers & Times & Dates & Other Data Types
Declaration
Data Type
_


Dim VariableName As Data Type
Integer
Dim X AS integer
Dim X,Y AS integer

Dim X AS integer = 5
String

10

Dim X AS String
Dim X,Y AS String

Dim X AS String = 5, Y AS Double = 3.4
Data Type
String - Boolean - Date - Object - Number
String
Text
Dim Mido AS String
Mido=""
Boolean
True False
True = -1 , 1
False = 0
Dim Success AS Boolean
Date
Dim xdate AS Date
xdate=#10/10/1985#
xdate=#10:10:00 AM#
Data Type Object

Dim Mido
Dim Mido AS Object

11

Number
Integer - Decimal
Integer
)Byte - Short (Int 16) - Integer (Int 32) - Long (Int 64
Decimal Floating Point Numbers

Single - Double
Double Single
Single

Local Variables - Global Variables




Life Time

12

Public Shared


)Form1.x.(Method

13

Constants

Const X AS Integer = 5


Public Const X AS Integer = 5

x=2


Math Operations
*
/
\
-
+
^

14

)(msgbox


)]Msgbox(Prompt,[Button Style],[title
)""",MsgBoxStyle.YesNo, "(Msgbox
)""" "(Msgbox


Dim m As String
m = MsgBox("Power Earth.4t.com", MsgBoxStyle.YesNo,
)""Mohamadie

)(inputbox

Structure

15

inputbox(Prompt,[title],[Default],[Xpos],[Ypos])
inputbox("Mohamadie","Power Earth.4t.com","Mido",20,20)


Dim m As String
m = Inputbox("Mohamadie","Power Earth.4t.com","Mido",20,20)

16



Conditions

If . . . Then

If Condition Then Statement 1:Statement 2:Statement 3:.........
If X = "Mohamadie" Then End:Msgbox("Power Earth.4t.com")

If Condition Then
Statement 1
Statement 2
Statement 3

Statement n

17

End If
If Year = 1985 Then
Name = "Mohamadie"
Faculty = "CS & IS"
Country ="Egypt"
End If

End If

If Condition Then
StatementBlock 1
StatementBlock 2
StatementBlock 3

StatementBlock n
Else
StatementBlock n+1
End If
If A = "Tanta" Then
Name = "Mohamadie"
Else

18

)"Msgbox("Not Included
End If
"Name = "Mohamadie
Else

If Condition Then
Statement 1
ElseIf Condition Then
Statement 2

Else
Statement
End If
Statement 1
Statement 2

Else


Select Case TestValue
Case Value 1
19

Statement 1
Case Value 2
Statement 2

End Select
Dim X AS Single
X = Textbox1.text
Select Case x
Case Is < 50
)" "(Msgbox
Case 50:64
)""(Msgbox
Case Is = 65.1
)" -"(Msgbox
End Select
X < 50

20



Loops

For . . . Next
]For Counter = Start To End [Step Increament
Statements
]Next [Counter

21


Do . . . Loop
Do While Condition
Statements
Loop
Loop
Loop

Do . . . Loop
Do Until Condition
Statements
Loop
Loop
Loop

While . . . End While


While Condition

22

Statements
End While
While =
True
End While False

23

Arrays
Store In Collections
Hash Table

Dim Names(5) As Integer



)Names(0
)Names(1
)Names(2
)Names(3
)Names(5
Dim Names(5) As Integer = {
}

= )Names(0

= )Names(5

24


))Msgbox(LBound(Names

))Msgbox(UBound(Names

)Msgbox(Names.length

25

26

27

Procedures
Procedure

)[Privat|Public] Sub ProcedureName(Arg 1 , Arg 2 , . . .




)Call ProcedureName(Arg 1 , Arg 2 , . . .

Private

Public

28

Call Form1.mido()

29



Modules
Procedures - Functions

.vb

Call

30

Functions

[Privat|Public] Sub FunctionName(Arg 1 , Arg 2 , . . .) As DataType

Public Function TotalSum(Num1 AS Integer,Num2 AS Integer) AS


integer
TotalSum = Num1+Num2
End Function
Dim T As Integer
T = TotalSum(10+10)

31



Forms
Application
Form1

Properties

32

33

False
)(frm.Hide

Public

34



Menus
Interface


VB.NET


35



Shortcut Menus
Right Click
Interface


VB.NET

ContextMenu


RichTextBox

36


CheckBox
Examples
CheckBox


If CheckBox1.Checked = True Then
TextBox1.Font = New System.Drawing.Font(TextBox1.Font,
FontStyle.Bold)
End If

37


RadioButton
Examples
RadioButton


If RadioButton1.Checked = True Then
TextBox1.Font = New System.Drawing.Font(TextBox1.Font,
FontStyle.Bold)
End If

38


ListBox
Examples
ListBox Items


Items

39


)""ListBox1.Items.Insert(Index,

40

41


ComboBox
Examples
ComboBox


Items

ListBox1

42

43


TextBox
Examples

TextBox

Access

44

TextBox

TextBox

45


RichTextBox
Examples
RTF Language
RTF Text
Notepad-Wordpad-HTML

Access
RichTextBox

46

Align

SelectAll

Delete

Cut

Copy

Paste

Undo

Redo

47

48


PictureBox
Examples
PictureBox


Rotate
PictureBox1.Image.RotateFlip(RotateFlipType.Rotate270FlipXY)
PictureBox1.Refresh()
Zoom Out
49

Zoom In

Copy

Paste
If Clipboard.GetDataObject.GetDataPresent(DataFormats.Bitmap)
Then
PictureBox1.Image =
Clipboard.GetDataObject.GetData(DataFormats.Bitmap)
End If
Clear

50


Common Dialog Controls
Examples
Common Dialog FontDialog

ColorDialog

OpenFileDialog

SaveFileDialog

PrintDialog


FontDialog

ColorDialog

51

OpenFileDialog
OpenFileDialog1.Filter = "Images|*.bmp;*.gif"
If OpenFileDialog1.ShowDialog = DialogResult.OK Then
PictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName)
End If
SaveFileDialog
SaveFileDialog1.Filter = "Images|*.bmp;*.gif"
If SaveFileDialog1.ShowDialog = DialogResult.OK Then
PictureBox1.Image = Image.FromFile(SaveFileDialog1.FileName)
End If

52

Graphics
GDI OR GDI+
Graphic Design Interface
Classes
Windows
GDI+

Pen Two EndPoints
Event Paint


)Dim P As Pen = New Pen(Color.Gray
Dim width As Integer = 50
Dim height As Integer = 100
)Me.CreateGraphics.DrawRectangle(p, 5, 5, width, height

53


Me.CreateGraphics.DrawRectangle(Pen, X, Y, width, height)
Ellipse

Me.CreateGraphics.DrawEllipse(Pen, X, Y, width, height)
Points Pen
Brush

Dim sBrush As SolidBrush


sBrush = New SolidBrush(brushcolor)

54


TreeView
Examples
TreeView Control


Root Nodes

Node

Node

55

Nodes.Remove(index)
OR
TreevView1.SelectedNode.Remove
OR
TreeView1.Nodes(0).Nodes(2).Remove

56


ListView
Examples
ListView Control


ListView1.Items.Add(Caption,index)
ListView1.Items(index1).SubItems(index2)
ListView1.CoulmnHeaders.Add("Mohamadie")

57

TreeView Control
TreeView

TreeView

58


MDI

Multiple Document Interface (MDI)

Adobe ImageReady - Excel - PaintShop Pro - Macromedia Flash Mx . . .

SDI
Single Document Interface (MDI)

Calaculator . . .

59

60


Panel
Panel Tools

61

GroupBox

62


TrackBar

Value Maximum & Minimum

63


ToolBar
Buttons

Buttons Buttons

64

65


TabControl
access screens

66


StatusBar
Help Information

True

67


ImageList

Images
ImageIndex ,ImageList

68


ErrorProvider
alert User

69

70

You might also like