Professional Documents
Culture Documents
Manual - VB
Manual - VB
c
(p
m
(p
(p
(p
(p
(p
(p
(p
#$
(p
(p
c!
(p
(p
(p
(p
%
P
(p
&"
(p
'
'
(p
(p
&&"
(p
(p
cc
(p
(p
(p
)
(p
#
(p
(p
#
(p
#
(p
#
(p
#
(p
#* #
(p
(p
(p
(
'
(p
(p
+ ,
(p
(p
$
(p
(p
$
(p
$*#
(p
$
(p
$&#
(p
$"
(p
&
(p
'
(p
(p
*-%P
(p
c-.%P
(p
/
(p
(p
0(
(p
&
'
(p
(p
/&/-
(p
'
(p
-
(p
1
(p
c
(p
(p
(p
c
(p
(p
(p
(p
(p
(p
(p
.
(p
(p
( "
(p
(p
*-
(p
*
(p
(p
(p
{3+
(p
(p
(p
*
(p
(p
(p
(p
#$$"!
(p
$"!
(p
(p
)
(p
+
##
(p
(p
(p
c
(p
(p
(p
(
(p
(#3+
(p
('
(p
(
(p
$
(p
'
(p
(p
(p
(p
*
(p
(p
(p
0
(p
(p
c
(p
#
(p
c
(p
#
(p
"
(p
(p
"
5% 0P
(p
0&
(p
(p
0&
(p
*c#
(p
(p
(p
{
*
*#
*
(p
**
(p
"*
*( #
m
!
$
" )
*
(
+ + "
,
(-
. /
,# -
"
. ! ,
'-
0
!
0
,* ' -
.
,-
1
(p
& " "' 5 "
"!
(p
(p
& + 5 "
#
23#!
* #
4
"
"
(
#
"
(
#
"
4
!
5
!6
!
0 "!7
8 0
#
,
m
-
!
0
!
1
(p
(p
#
+
!
.vbproj
!
.sln
!
4 1<
?
.
"
0 .vb#
/
/
"
4
5 6
/
(
Abs(P
%
Atan(P
%
os(P
%
0
Exp(P
%
%
0
Sqr(P
%8
Tan(P
0 / . "
#%+ P
(p
4 !
3%
"
$
!
"
( 3#
.
!
"
!
0
4
>
# $
7
!
.
,
%;-
,; -
$
7 c!
7
/
/
4
7
0
1
(p
2 / 5 #
5 !
# !!
! .
3 " " "!#
#"! "
p
p
p
p p ? p
p ppp p
p p
p
pp
! 3/
3 + "!5
/ # 3 "!
5!"3
* 3 + 3
# + #
3 #
(p
(p
/ # 5
. # # / 5 +
# # 5
# .
%
"
"
0
1
(p
& / "
!
(p
c / " + 5
# " /
* { %{ P
%
"
"
"
"
"
%
4"
Button
abel
&"
PictureBox
Timer
Text Box
'
ist Box
&
ombo Box
"
heck Box
nombreontrol.Format
DateTimePickerFormat.Time
%
. ;.
" 7<.
"
1
inkabel .inkVisited
True
System.Diagnostics.Process.Start(inkabel .TextP
(
inkabel .Text
Text
"1333%13 !
! 133***#
)
# "
7<.
/
1
System.Diagnostics.Process.Start("firefox.exe", inkabel2.TextP
'a pgina se mostrara utilizando el navegador
/
StartProcess
. Process ! !
"
System.Diagnostics
"System.Diagnostics
Process.Start *
1
System.Diagnostics.Process.Start(inkabel3.TextP
'Donde el valor de inkabel3.Text es "winword"
Start @
"
" !
!
$
" 01
System.Diagnostics.Process.Start("excel", "c:pagos.xls"P
%
>
%
B
!
2-
"
$c
%
$ $
%
cc +
+
"
4 +
cc
/
"
+ "
+
"
7
cc
"
Bandeja de omponentes
"
"
!
"
+
/
+
+ "
4 "
+
"
!
C
!
" 8
&
#
+
#
+
5*6
5 6
4
+
1
Private Sub MenuItem2lick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles MenuItem2.lick
MsgBox("opcin "P
End Sub
Private Sub MenuItem3lick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles MenuItem3.lick
MsgBox("opcin 2"P
End Sub
Private Sub MenuItem5lick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles MenuItem5.lick
MsgBox("opcin 2 "P
End Sub
:
(p
/ # 9 #/
(p
(p
R
/#
#
(p
/# :;
(p
/ # " 9 %
?P
(p
R/# 9
(p
/##+
(p
:
:
"
"
Pmt(ate,Nper,PVP
FV(ate,Nper,PmtP
"
"
"
:
2
(p
(p
/ # + 5 +
(p
/# 9
(p
/# 9
(p
(p
(p
(p
/ " / " "
'
(p
(p
/ 5 +#
+
(p
(p
(p
(p
/ 5
+#3#
/ "
"
#!
ShowDialog(P
ShowDialog(P
Dialogesult
> :(
$ #
"
!
.
InitialDirectory "
!
.
Filter
"
!
!
ShowDialog
FileName
!
#
OpenFileDialog
PictureBox
,D D" D*" D
D
D D D D"-
Filter "
!
"
"
, "
"
8
|-1
ofd.Filter
"formato |*.jpg|formato 2|*.bmp"
ofd.ShowDialog(P
pb.Image
System.Drawing.Image.FromFile(ofd.FileNameP
Dim dr
dr
ofd.ShowDialog(P
MsgBox(drP
. 8
1
pb.Image
Nothing
%
(
#
"
"
ShowDialog
color
# "
"
#
EM Agregando un control olorDialog al formulario
Private Sub BtnBgolorlick(ByVal sender As System.Object, ByVal e
As System.EventArgsP
Handles BtnBgolor.lick
D.ShowDialog(P
blText.Backolor
D.olor
End Sub
EM Declarando un objeto tipo olorDialog via cdigo
Private Sub BtnForeolorlick(ByVal sender As System.Object
, ByVal e As System.EventArgsP
Handles BtnForeolor.lick
Dim F As New olorDialog
F.ShowDialog(P
blText.Foreolor
F.olor
End Sub
:
(
#
"
"
"
"
E" /
!
"
!
"
8
"
ShowDialog
font
# "
"
#
Private Sub BtnFontlick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles BtnFont.lick
Dim FD As New FontDialog
FD.ShowDialog(P
blText.Font
FD.Font
End Sub
4 (
#
"
8
)
*
!
1
.
Document
PrintDocument
ShowDialog
"
PrintDocument
Print
4 4*(
#
"
8
.
Document
PrintDocument
!
)
*
E
ShowDialog
4# (
#* #
"
"
.
Document
PrintDocument
4#
ShowDialog
PageSettings8
PrintDocument
(
Variant
Dim
as tipoDato
Dim
. "
.
+
(+
"
"
1
(p
(p
(p
"
<
1
(p
(p
" " "6 # "
" 9
(p
" " "6 + #
#+ +!"
7
!
1
Dim nombreVariable as tipoDato
valorInicial
#
"
" Object
! C
Option Explicit Off
Option Explicit Off
Private Sub Form oad(ByVal sender As System.Object
, ByVal e As System.EventArgsP
Handles MyBase.oad
v
"xxx" & 5
MsgBox(vP
End Sub
End lass
Option Strict
(p
(p
9" + /" 9 +
(p
0
" InputBox
Dim sespuesta As String
sespuesta
InputBox("Password : ", "Usuario", , 5, 5P
If sespuesta <> vbNullString Then
MsgBox("Validacin de usuario y password pendiente..."P
Else
MsgBox("Es necesario proporcionar su password"P
End If
" 0
0
8
+
B
+
(
.
1
"
.
/* /(#&#
.
"
*# "
.
"
7
.
*# 7
" FCE
GH === 7 7
FCE = CHH?H .
F@I ,=EF@J-
7
#%(?@F@J
"
7#(F@I@HH
"
"!
F@1==1==$
F?F(KKKKFF1HK1HK4$.
"!
>
"
22
'F@3J3FKJF'
$"!
"
"
(
:
%
%
<
/
(
2
@
Boolean
True
Byte
har
Date
%
False Bool
#
(=@HH
F
@
65535 Byte
:: Enero
I
del
:59:59 PM Deciembre
Date
3 del 9999
Decimal
FC
79,228, 62,5 4,264,337,593,543,95,33
5,
-
%
0
#
=
CHH?H
%
0
"!
+
Dec
@I
-
Double
(punto
.797693 348623 57
foltant
I
E38
e de
4.946564584 246544
doble
E324
precisi
4.946564584 246544
E324
.797693 348623 57
E38
+
Dbl
nP
Integer
ong
+
G
2, 47,483,648
2, 47,483,647 Int
I
9,223,372,36,854,7
75,88
9,223,372,36,854,7
75,87
+
ng
Object
Short
G
Object
@
32,768
Obj
+
32,767 Short
"
Single
,
3.428235E38
G
.4 298E45
-
String
G
%
0
.4 298E45
3.428235E38
+
Sng
"
0
@
Str
7
(
("
7
1#
Structure
1
Structure Persona
Dim sNombre As String
Dim nEdad As Integer
Dim dFechaNac As Date
End Structure
Private Sub Form oad(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles MyBase.oad
Dim Empleado As Persona
Empleado.sNombre
"Gerardo ngeles Nava"
Empleado.nEdad
33
Empleado.dFechaNac
"2 9 97 "
txtOutput.Text
Empleado.sNombre & vbNewine
txtOutput.Text Empleado.nEdad & vbNewine
txtOutput.Text Empleado.dFechaNac
End Sub
%
"
(" 1
Dim Empleado As Persona
{}
%
7
#
+
onst PI As Double
3. 4 59265
#
"
Public
EM Escribir en un Mdulo
Public onst PI As Double
3. 4 59265
>
1
>
(
#
<
*
$
(
Mod
<
,
-
^
0
,
-
&
%
%
Dim nInc As Integer
For nInc
To
If nInc Mod 2
Then
txtOutput.Text nInc & " es par " & vbNewine
Else
txtOutput.Text nInc & " no es par " & vbNewine
End If
Next
txtOutput.Text "
" & Str( P
. =
"
C !
FF L !L
R
4
0
=Infinito
+1
If Str( P
"infinito" Then
MsgBox("manejador de clculo"P
Else
MsgBox("No es lo mismo infinito e Infinito"P
End If
If Str( P
"Infinito" Then MsgBox("manejador de
clculo"P
>
.
,^,*,,,Mod,,-
>
#
,&- #
#
#
>
%
.
%
%
,>,<,> ,< , ,<>-
,True or False-
>
.
.
.
.
,NOT,AND,O,XO-
>
"
1
x
x
'Antes escribia
x
'Ahora puede escribir
>
*
^
&
4 >
3
38
4 >
( P
^
*
Mod
# %
"
"
C
# %
For
+
Do
+
#
F
0
"
"
0
7 Until " While
0
While 0
8
A <> B
Until
8A
B
. +
While While ... Wend !
While
... End While
@
1
>
.
(
And
.@0
Or
Not
0
Xor
#F
F0
AndAlso
OrElse
#
.
AndAlso OrElse
"
Dim nalificacion As Integer
If nalificacion < AndAlso nalificacion Then
MsgBox("Error de lgica"P
Else
MsgBox("ontinuar clculo"P
End If
4
AndAlso
OrElse
!
If
If3else
Dim nalificacion As Integer
If nalificacion < OrElse nalificacion Then
MsgBox("Error de lgica"P
Else
MsgBox("ontinuar clculo"P
End If
(
.
.
Do ... oop
!
0
Do ... oop1
(p
(p
(p
(p
(p
(p
(p
(p
(p
(p
(p
p
p
p
p
p
p
p
p
p
p
p
(p p p
(p p
(p p pp
(p p ppp p
(p p p pp
(p p p
0
. Exit
%
Timer
"
Timer
Interval
True !
%
Timer
"
"
, %
-
"
TimerTick
4
Interval
4
Timer
EnabledTrue
4 Timer
Stop(P
Dim i As Integer
Private Sub btnIniciolick(ByVal sender As System.Object
, ByVal e As System.EventArgsP
Handles btnInicio.lick
Timer .Enabled
True
End Sub
Private Sub Timer Tick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles Timer .Tick
lblTic.Text
Str(iP
i
End Sub
Private Sub btnFinlick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles btnFin.lick
Timer .Stop(P
End Sub
# < ,-
" nd(P
,
-
==F=
Private Sub BtnMakendlick(ByVal sender As System.Object, ByVal e
As System.EventArgsP
Handles BtnMakend.lick
TxtOut.Text
nd(P
End Sub
+
,
-
0
!/ 5
" 5 +
# 6 '
/5
7 #!4
(p
(p
#/ 5 ) /
/ + + 5
#/ 53
# " 3 3
+ #/ +
.5
& # 8
5 !
5 5 " # 8
#+ 4
p pp
ppp
* + " /
5 3 +;
+= 2 =/ / 5
5 .
/ 565 6+
p pp
ppp
&. 3+ #5
+ " /
5 + #
# ! 5
6 5 '/ 5
#'4
pp
p p
?? p
p p??p
p p p p p p p p p p p p
p
pp p pp
pp
p
p
p
7
"
!
1
(p
(p
(p
(p
6 " " "
#
7
+
%
0
.
,-
1
>file.
4
(3)
*3
1
(p
c(%R P
(p
4
1
(p
^/3(
(p
^ /3(
%
E
.0(
sNombre
1
?sNombre
%
.
0
istBox !
Private Sub Form oad(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles MyBase.oad
stBox.Items.Add("ed"P
stBox.Items.Add("Green"P
stBox.Items.Add("Blue"P
End Sub
Private Sub stBoxSelectedIndexhanged(ByVal sender As System.Object
, ByVal e As System.EventArgsP
Handles stBox.SelectedIndexhanged
stBoxOut.Items.Add(stBox.SelectedItemP
End Sub
Private
System.Object
Sub
stBoxOutSelectedIndexhanged(ByVal
sender
As
, ByVal e As System.EventArgsP
Handles stBoxOut.SelectedIndexhanged
stBoxOut.Items.emove(stBoxOut.SelectedItemP
End Sub
:
. " IsNumeric(P
0
+
"
Private Sub btnIsNumberlick(ByVal sender As System.Object, ByVal e
As System.EventArgsP
Handles btnIsNumber.lick
If IsNumeric(TxtInput.TextP Then
MsgBox("Si es nmero"P
Else
MsgBox("No es nmero"P
End If
End Sub
!"
+
"
+
"
"
"
m !
M
. <
"
1
(p
(p
(p
%
%!;
0
7
heckBox
"
+
%
<
7
adioButton
A4
KeyPress
+ +
0
12 A%!
A%!
.
2
True
"
+
1
Private Sub TextBox KeyPress(ByVal sender As Object, ByVal
e
As
System.Windows.Forms.KeyPressEventArgsP
Handles
TextBox .KeyPress
If IsNumeric(e.KeyharP Then e.Handled
True
End Sub
+
,
-1
Private Sub TextBox KeyPress(ByVal sender As Object, ByVal
e
As
System.Windows.Forms.KeyPressEventArgsP
Handles
TextBox .KeyPress
EM If IsNumeric(e.KeyharP Then e.Handled
True
If (Asc(e.KeyharPP > 48 And (Asc(e.KeyharPP < 57
Or
(Asc(e.KeyharPP
System.Windows.Forms.Keys.Back Then
e.Handled
False
Else
e.Handled
True
End If
End Sub
,
-1
Private Sub txtetrasKeyPress(ByVal sender As Object, ByVal
e
As
System.Windows.Forms.KeyPressEventArgsP
Handles
txtetras.KeyPress
If (Asc(e.KeyharPP > 65 And (Asc(e.KeyharPP < 9 Or
(Asc(e.KeyharPP > 97 And (Asc(e.KeyharPP <
22 Or
(Asc(e.KeyharPP
System.Windows.Forms.Keys.Back Then
e.Handled
False
Else
e.Handled
True
End If
End Sub
%
)
*$4
c
!
"
$4N )$(
!
3<
0 3%>$3)
*$4
Private Sub BtnOpenlick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
'Ocurrio
un
error
en
el
control
del
ndice,
desbordamiento
atch
'ontrolar el error
End Try
4
+
Try
atch
Exit try
Finally
+ Try atch
Finally
Try
'sentencia(sP que pueden generar un error en tiempo de
ejecucin
'Bajo determinada condicin p
atch
'(el error se generoP
'sentencia(sP que definen las acciones a seguir ya que se
genero el error
'Bajo determinada condicin p
Finally
'sentencia(sP que reestablecen las condiciones antes de
generarse el error.
End Try
<
Number
+
Description
" +
$
.
"
!
"
1
>
ByVal
"
Byef
Private Sub Form oad(ByVal sender As System.Object,
ByVal e As System.EventArgsP Handles MyBase.oad
Dim i As Integer
5
multiplica(iP
MsgBox(iP
End Sub
Module miModulo
Sub multiplica(ByVal j As IntegerP
j * j
End Sub
End Module
* 1H
#ByVal
Byef* 25
"
1
Dim aolores(2P As String
aolores(P
"ojo"
aolores( P
aolores(2P
"Verde"
"Azul"
(p
(p
#3
5 6 +
#
(p
#3 9 ;
Dim aNumeros(P As Integer
{ , 2, 3, 4, 5}
Dim i As Integer
txtOut.Text "eft Bound : " & Bound(aNumerosP & vbNewine
txtOut.Text "Upper Bound : " & UBound(aNumerosP & vbNewine
For i
To UBound(aNumerosP
txtOut.Text i & " : " & aNumeros(iP & vbNewine
Next
(p
(p
(p
(p
# 3/ 9 "
! #
# 3"5
# 83+
, . # " " 9
. / #
3+ "
edim Preserve
"
edim
"
null
"
Preserve.+ +
0
/
+
8
Dim aMultidimensional(,,,P As Integer
eDim aMultidimensional( , 2, 3, 4P
eDim Preserve aMultidimensional( , 2, 3, 8P
%
. % Array
+ :
.%Array
Sort
1
Dim i As Integer
Dim aNumeros(9P As Integer
Private Sub Form oad(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles MyBase.oad
For i
To 9
andomize(P
aNumeros(iP
nd(P * 9
Next
ShowElements(aNumeros, istBox P
End Sub
Private Sub ShowElements(Byef a As Array, ByVal list As istBoxP
For i
To 9
list.Items.Add(a(iPP
Next
End Sub
Private Sub BtnOrderlick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles BtnOrder.lick
Array.Sort(aNumerosP
ShowElements(aNumeros, istBox2P
End Sub
%
.
1
'Declarar una variable del tipo ontrol para representar controles
de formulario
Dim ctrl As ontrol
Private Sub Form oad(ByVal sender As System.Object,
ByVal e As System.EventArgsP Handles MyBase.oad
Dim i As Integer
For Each Me.ctrl In ontrols
If ctrl.Name <> "x" Then
ctrl.Text
i
End If
Next
End Sub
$
$ !
0
0 "
!
0
Filesystem1
(p
/
'
"
R
/ 6 '
(p
(p
(p
(p
(p
ppppppppp
pp p
ppppppppRppp p
pppppppppppp
p p
? p
pppppppppppp
? p p
p
pppppppppppp
? p
p
pp pppppp R
pp
p
pppppppppppp p
pp
pppppppp p
pppppppppppp p p pppp p
p p
pppppppppRp
pp
p
p
(p
(p
(p
(p
(p
(p
(p
p
ppppppppRpp p p p p
pp
p
p
p
(p
%
!
0
"
!
"
"
!
0
!
+
"
txt ini log
inf
(p
p / + "
+
As
e As
e As
e As
e As
sfd.Filter
"Archivos de texto txt|*.txt"
sfd.ShowDialog(P
If sfd.FileName <> vbNullString Then
FileOpen(2, sfd.FileName, OpenMode.OutputP
Printine(2, txtOut.TextP
Filelose(2P
MsgBox("Archivo almacenado"P
End If
End Sub
$ %
(p
(p
(p
(p
(p
(p
, + R R /
#
(p
, + / "
+
(p
(p
, R / ##
(p
, + / +
9 9 /# # 4
(p
/
(p
(p
/+
1
Dim s As String
Private Sub Form oad(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles MyBase.oad
lblTitulo.Text
s.oncat("
", "www", ".", "informatique", ".",
"com", ".",
"mx", " ", "Tutoriales de Programacin
"P
End Sub
(p
## + ' %!2 -+2c+ '
$"!&"P
(p
" "!'
(p
(p
pp
4 ## + 3 "
+ "!'
7"
"
" "! ! #"
6+/
& "
# 8
" 5 "! ./
.
+ 5
6+ "
1
Dim xlsApp As Excel.Application
Dim xlsBook As Excel.Workbook
Dim xlsSheet As Excel.Worksheet
Dim sFile As String
xlsApp
Type(reateObject("Excel.Application"P,
Excel.ApplicationP
xlsBook
Type(xlsApp.Workbooks.Add, Excel.WorkbookP
xlsSheet
Type(xlsBook.Worksheets( P, Excel.WorksheetP
xlsSheet.ells(
xlsSheet.ells(
xlsSheet.ells(
xlsSheet.ells(
, P
, 2P
, 3P
, 4P
"www"
"informatique"
"com"
"mx"
xlsSheet.ange("B "P.Font.Bold
True
xlsSheet.Application.Visible
False
sFile
"c:prueba" & Now.Day & Now.Month & Now.Year
& Now.Hour & Now.Minute &
Now.Second
&
".xls"
xlsSheet.SaveAs(sFileP
xlsSheet
Nothing
xlsBook.lose(P
xlsBook
Nothing
xlsApp.Quit(P
xlsApp
Nothing
MsgBox("Se ha creado el archivo : " & sFileP
"
#
excel.exe
Excel.Application
EXE.EXE
!
"
"
%
4
Process.Start
# # 0 !
#
"
4
)
*1
System.Diagnostics.Process.Start("calc.exe"P
7
.
"
#
"
)
*
(
Process
StartInfo
'
FileName
Arguments
(
Start(P
loseMainWindow(P
Kill
#
Threading Diagnostics 8
+ StartloseMainWindow
Private Sub btnalclick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles btnalc.lick
System.Diagnostics.Process.Start("calc.exe"P
End Sub
Private Sub btnOpenlick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles btnOpen.lick
Proc.Start(P
End Sub
Private Sub btnloselick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles btnlose.lick
Proc.loseMainWindow(P
End Sub
(
.
#
!
"
#
"
7
1
(p
# &#! ( c+ %c*(&P/ 5 #
# #! "
#!9
(p
(p
c+/ + " "/ /
" / + #/ +
" "
(p
$
0
digo MSI
Metadatos
(p +//
(p 5 +//
Manifiesto
(p
"
(p &
(p " 5 +
(p -'
(p (+#
%
"
#
4
"
4
!
:*
;
4
1
(p
(p
2 2!
(p
! 2* ! %#9 5
# /" 5'@ P
(p
(p
(p
*
(p
"A$1B
(p
(p
(p
(p
(p
"A$1B
(p
(p
(p
* 5
"
(p
(p
5 ' #
3 # "+
(p
* ? % P 5 3 .
(p
(p
(p
(p
" +
/!
(p
* / " /
(p
&"#
(p
(p
2
* / /
+ "
(p
4 1
(p
(p
c /#
(p
(p
( "/ . ( "
. (
(
:
7 "
!
%
System.Windows.Forms.Form
4 "
"
"
"
Show,"
E
-
Dim frm2 As New Form2
frm2.Show(P
. "
C "
#
$
08"
"
!
"
c
"
ShowDialog
Dim frm2 As New Form2
frm2.ShowDialog(P
4"
!
! "
4!
%System.IO
"
Rp ?R
Public lass Form
.
.
.
Dim sr As Streameader
sr
New Streameader("c:Test.txt"P
txtOut.Text
sr.eadToEnd
sr.lose(P
++P
/
$
(
lose
%*-
Peek
<0
ead
.0
0
eadine
eadToEnd
# )
. % * / !
" File.reateText(% P
" !
8
!
1
(p
(p
++P
/
$
lose
(
% *
Flush
."++
"++
Write
Writeine
"
8
%
0 1
Dim btnOK As New Button
btnOK.Text
"OK"
btnOK.ocation
New Point(3 2, 5P
Me.ontrols.Add(btnOKP
0
!
Dock Anchor
?
(p
?
(p
?
(p
?
(p
+ "
"
+
"
4
"
4
34
, %
- "
# ""
8
N"
0
"
{(C
System.Drawing
% . 4#
DrawEllipse Drawine 4
System.Drwaing.Graphics
c
(p
c
(p
D(
(p
{(
(p
(
(p
{
(p
c
c
(p
{
(p
(
(p
c
$
(
.8
Drawine
<
Drawectangle
DrawArc
%8
3 DrawEllipse
%
<
.8
:8
4
8
DrawPolygon
:
+
%
Drawcurve
.8
+
DrawBezier
%
,
@?
-
.
"8
0
"
"
4 !
System.Drawing.Graphics
Graphics
Pen
Brush
"
Pen
Brush
Graphics
reateGraphics)
*:
System.Drawing.Graphics
Dim Grafico As System.Drawing.Graphics
Dim apiz As New System.Drawing.Pen(System.Drawing.olor.BlueP
Grafico
Me.reateGraphics
Grafico.Drawine(apiz, 2, 3, , 8P
oad "
!
"
"
Paint"
4
" 1
(p
(p
(p
/5"!
(p
/5+ 6"!
8+
Private Sub btnIzqlick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles btnIzq.lick
btn.eft
End Sub
(p
"
0
%
"
" "
+ "
7
8
"
0
!
0
/
0
.
+Private
Protected
0
"
#
Private
"
2
. ) !
0 0
0
. !
)
.
8
. 2
%
8
"
%
"
01
Public lass
.
.
.
End lass
.
0
{/
&*
4 %! "
% 0
Inherits
4
"
+ !
"
"
8
%
."
"
Get Set
0
! "
"
. "
+
."
"
Get Set
0
! "
"
. "
+
Private|Public lass nombrelase
campos
propiedades
constructores
mtodos
End lass
1 !3
%
1
Public lass Persona
Private sNombre As String
Private nEdad As Integer
Private bSexo As Boolean
End lass
"
1
Public lass Persona
Private sNombre As String
Private nEdad As Integer
Private bSexo As Boolean
Public Property Nombre(P As String
Get
eturn sNombre
End Get
Set(ByVal Value As StringP
sNombre
Value
End Set
End Property
End lass
#
1
Public Sub sexoPersona(P
If bSexo Then
MsgBox("Hombre"P
Else
MsgBox("Mujer"P
End If
End Sub
%Persona1
Public lass Persona
Private sNombre As String
Private nEdad As Integer
Private bSexo As Boolean
* "
/
% #P. " + %
++P
(p
" /
. 9 3 5
0"!.+
4
.
0
,(
-
"
.
!!
0
Get
Set
4
0
eadOnly
8
SetEnd Set
[eadOnly] property nombrePropiedad as tipoDato
Get
return nombreampo
End Get
[Set(ByVal valor as tipoDatoP
nombreampo
valor
End Set]
$
.
"
.
[Private|Public] Sub nombreMetodo([parmetros]P
sentencias
End Sub
[Private|Public] Function nombreMetodo([parmetros]P as tipoDato
sentencias
End Function
%
7
New7
#
+
"
Sub New([parmetros]P
sentencias
End Sub
%
"
8
7
"
MyBase
Sub New([parmetros]P
MyBase.New([parmetros]P
End Sub
#
%
PrintDocument,
"
-
!
! C
4 "
4 (
4 4*(
# (
#
PrintPage
. % PrintDocument
PrinterSettings "
PageSettings"
PrintPageEventArgs
" "
System.Drawing.Printing
PrintDocument
"
"
1
Imports # (* 4
%
PrintDocument
PrintPage
Graphics.MeasureString "
/
+
8
"
" /
0
"
Graphics.PrintString
"
!
"
.
HasMorePages
8
"
%System.Drawing.Printing
"
1
Imports System.Drawing.Printing
Public lass Form
.
.
.
PrintDocument,
"
-
1
Private Sub imprimirImagen(ByVal sender As System.Object,
ByVal ePrint As PrintPageEventArgsP
ePrint.Graphics.DrawImage(Image.FromFile("c:relog.ico"P
, ePrint.Graphics.VisiblelipBoundsP
ePrint.HasMorePages
False
End Sub
,
-
Private Sub btnPrintlick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles btnPrint.lick
Try
AddHandler printDoc.PrintPage, AddressOf Me.imprimirImagen
printDoc.Print(P
atch ex As Exception
MsgBox("Ex : " & ex.ToStringP
End Try
End Sub
0
"
0
##
PrintDocument
1
1
Imports System.Drawing.Printing
1
Private Sub ImprimirTexto(ByVal sender As System.Object, ByVal ePrint
As PrintPageEventArgsP
ePrint.Graphics.DrawString(txt.Text,
New
Font("Arial",
,
FontStyle.egularP,
Brushes.Black, , P
ePrint.HasMorePages
False
End Sub
PrintDocument
!
1
Dim prnTxt As New PrintDocument
0
0
1
Private Sub bntPrnTxtlick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles bntPrnTxt.lick
Try
Dim prnTxt As New PrintDocument
AddHandler prnTxt.PrintPage, AddressOf Me.ImprimirTexto
prnTxt.Print(P
atch ex As Exception
MsgBox("Ex : " & ex.ToStringP
End Try
End Sub
(
0
!
8
!
" 8
0
4
PrintPage
Graphics.MeasureString
!
Imports System.IO
Imports System.Drawing.Printing
(
,
# #
-
Private OptPrnPage As New PageSettings
Private StrToPrn As String
Private FontPrn As New Font("Arial", 2P
> :(
0
!
0
Private Sub btnOpenFilelick(ByVal sender As System.Object, ByVal e
As System.EventArgsP
Handles btnOpenFile.lick
OFD.Filter
"txt|*.txt"
OFD.ShowDialog(P
If OFD.FileName <> vbNullString Then
Try
Dim FS As New FileStream(OFD.FileName, FileMode.OpenP
TB.oadFile(FS, ichTextBoxStreamType.PlainTextP
FS.lose(P
StrToPrn
TB.Text
atch ex As Exception
MsgBox("Ex : " & ex.ToStringP
End Try
End If
End Sub
4 (
!
Private Sub btnPrnFilelick(ByVal sender As System.Object, ByVal e
As System.EventArgsP
Handles btnPrnFile.lick
Try
prnFile.DefaultPageSettings
OptPrnPage
StrToPrn
TB.Text
PD.Document
prnFile
Dim D As Dialogesult
PD.ShowDialog
If D
D.OK Then
prnFile.Print(P
End If
atch ex As Exception
MsgBox("Ex : " & ex.ToStringP
End Try
End Sub
(
PrnFile,4 (
F-
Private Sub PrnFilePrintPage(ByVal sender As System.Object, ByVal e
As
System.Drawing.Printing.PrintPageEventArgsP
Handles
PrnFile.PrintPage
Dim nhars As Integer
Dim nines As Integer
Dim sPage As String
Dim sFormat As New StringFormat
Dim
rectAng
As
New
ectangleF(e.MarginBounds.eft,
e.MarginBounds.Top,
e.MarginBounds.Width, e.MarginBounds.HeightP
Dim MySize As New SizeF(e.MarginBounds.Width,
e.MarginBounds.Height
FontPrn.GetHeight(e.GraphicsPP
sFormat.Trimming
StringTrimming.Word
e.Graphics.MeasureString(StrToPrn,
FontPrn,
MySize,
sFormat,
nhars, ninesP
StrToPrn
StrToPrn.Substring(, nharsP
e.Graphics.DrawString(sPage,
FontPrn,
Brushes.Black,
rectAng,
sFormatP
If nhars < StrToPrn.ength Then
StrToPrn
StrToPrn.Substring(nharsP
e.HasMorePages
True
Else
e.HasMorePages
False
StrToPrn
TB.Text
End If
End Sub
(
%
$
"
(
ADO.NET,$
$
" #
-
8
$
" ADO
-$ $
(
$
!
dataset
"
ADO.NET Dc& ,m
) # #-
/
0
ADO.NET
"
"
"/
#
ADO.NET !
"
!
,
"
-
(>
$
:*
;
onnection DataAdapter DataSet"
(>
(
,!
-
onnection,OleDbonnection-
DataAdapter
DataSet
%
0
7
onnection !
"
!
4
0
3*'
' * ! "
0
"
% 3#
.
8
0
4
0 !
"
"
0 4
c+ @: $&
/
$
"
(
"'
#
0 " "
0
#
% %
0
onnection
OleDbonnection "
"
!
onnectionString
&,4
8
(
-
@===
B4
*!+)m <
(
"
!
/
0
" '
0 "
"
onnection
.
"
"
"
8 (
(
E
7 !
0
0 "
8"
dataset
4
0
#
"
! /
)
*:
>
!
DataAdapter DataSet
%
(
7
0
DataAdapter
,
- 7 DataAdapter
"
7
# . DataAdapter
m4
0
(
M
(
8 8
8
# . " "
0
(
"
(
!
OleDbDataAdapter
"
(
"
0
(
!
OleDbDataAdapter +
, * &
, # .- #
" $
"
# .#
* &
# .
+
&
+
"
"
(
"
$ ";
DataAdapter
( #
7
DataSet
0
0
7
"
# .
" -*
DataSet
%
" DataSet
"
"
8
#
3{
/
( #
%
(
#
!
NombreDataSet.xsd 0
B$.
N (
7 %
0
(
Dataset7 Dataset
"
$
+
+
4 Dataset
>
(
!
{ +
N (
"
(
"
(
:
0 ?
1 %
( ( (
%
0
(
(
(
!
( E*
7
0
%
8
(
"
( .
0
DataBound
%
7 . 8
"
DataBindings
'
' "
' &
'
' -
{
'
0
DataBindings
Text
1
Ds.lear(P 'nombre del control en la bandeja de componentes
Adapter.Fill(DsP 'nombre del control en la bandeja de componentes
Fill
0
"
$
:
7
E*
"
( 8
Fill
(
DataAdapter.Fill( P
(
%
E* 8
Databindings
!
(
"
E*
%"
Bindingontext
"
4 "
( 1
Bindingontext(Dataset, "NombreTabla"P
#'
Position
ount
(
+
F
ount
Private Sub Form oad(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles MyBase.oad
Daontratos.Fill(Dsontratos P
Bindingontext(Dsontratos , "TDetDatoServParamAsoc"P.Position
blount.Text
Bindingontext(Dsontratos ,
"TDetDatoServParamAsoc"P.ount
Infoeg(P
End Sub
Private Sub BtnPrevlick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles BtnPrev.lick
If
Bindingontext(Dsontratos ,
"TDetDatoServParamAsoc"P.Position
Then
MsgBox("Primer egistro"P
Else
Bindingontext(Dsontratos ,
"TDetDatoServParamAsoc"P.Position
Infoeg(P
End If
End Sub
Private Sub BtnNextlick(ByVal sender As System.Object, ByVal e As
System.EventArgsP
Handles BtnNext.lick
If
Bindingontext(Dsontratos ,
"TDetDatoServParamAsoc"P.Position
Bindingontext(Dsontratos ,
"TDetDatoServParamAsoc"P.ount
Then
MsgBox("ltimo egistro"P
Else
m !
"
!
M
ADO.NET "
+
urrencyManager
,( # -
)
* :
Bindingontext
"
c#"
4
1
Me.Bindingontext(Ds , "TParametro"P.Position
lblPos.Text
Me.Bindingontext(Ds , "TParametro"P.Position
4+
1
Me.Bindingontext(Ds , "TParametro"P.Position
Me.Bindingontext(Ds , "TParametro"P.ount
lblPos.Text
Me.Bindingontext(Ds , "TParametro"P.Position
4
1
If Me.Bindingontext(Ds , "TParametro"P.Position
Then
MsgBox("Primer egistro"P
End If
Me.Bindingontext(Ds , "TParametro"P.Position
lblPos.Text
Me.Bindingontext(Ds , "TParametro"P.Position
4
1
Then
MsgBox("ltimo egistro"P
End If
Me.Bindingontext(Ds , "TParametro"P.Position
lblPos.Text
Me.Bindingontext(Ds , "TParametro"P.Position
"TParametro"
lblPos.Text
(
( N
7
DataGrid "
,
-
DataSetDataAdapter
4 8
DataGrid
DataSourceDataMember
(p
(p
(p
{!%2{P
(p
(p
(p
(p
p ? p
p ?p
pp
p
" !%*P
$
"
( N
7
* ,
-
"
!
DataAdapter
#
"
!
{
1
(p
(p
4
1
Try
OleAdapter.Update(ontratos P
atch ex As Exception
MsgBox(ex.ToStringP
End Try
(p
(p
(p
(p
eb"P
#
!
0
8"
#
"
WithEvents
"
1
Public WithEvents oIE As SHDocVw.InternetExplorer
!
1
Public WithEvents oIE As SHDocVw.InternetExplorer
Private Sub btnOpenoadlick(ByVal sender As System.Object, ByVal e
As System.EventArgsP
Handles btnOpenoad.lick
oIE
New SHDocVw.InternetExplorer
oIE.Visible
True
oIE.Navigate(txtU.TextP
End Sub
Private Sub oIEDocumentomplete(ByVal pDisp As Object, Byef U As
ObjectP
Handles oIE.Documentomplete
MsgBox("El documento ha sido cargado"P
End Sub
):
"
"
*
8 "
- .# ,)8 "
#
,
%'-
"
/
#4, "
)
$
" /
:*
;-
"
*
#
" " "E
*#4 "
"
(
<
,' <
(
-
%):
!
1
(p
(p
#
!
#4B
*
!
2$.
E
#4
"
2$.
. ", :*
;
E
-
, :*
;
E -
E
2$. .
E
0
7 )
,.vb-
2$.
,.htmhtml- "
" ,Web.config-,Global.asax- 8
.
#4
!
Global.asax
*
!
*
%
!
"
!
*
0
4 )#4
)c&
"!
.
) :
* .
2$.
"
"
"
2$.
*
unat
.
)c&
2$.
"
+
#
targetSchema
DOUMENT
"
0
?=@ ?= H=
G=
"
0
H= 8
"
2$.
"
#
# )
" *
,#4 )
-
)
* @===
)
* B4 4
"
# 0
:
4 @===
:*
; B4 2
) #4
#
)
<
"
#
# 0
:
4
:*
; #
# 0
:
4
:*
;
:*
;
0
#
%,!E-
"
"
" 1
%34
. # E
% 3
.
*#
.# '<m
%3( .
(
'+m
.
+
0
.
0
.
0
"
"
%4 E4
.
.
, -
"
"
,- 2$.
"
% E
.
.
#
.
.
+
0
0
, -
0
%(
E( .
;
7 0
/
E
!
0
#"
0
24
. "
0
"
8 !
8
.
#
0
.
#
,#E# # $ ! -
#4 9
"
"
"
.
8
1
#
*,
-
!
%
* #4
"
" *
! 7<.
#4 *
!
*
!
"
*
,
-
7
Application
,
-
1 Application("Usuariosonectados"P
" .
*
"
#
#
7 8
+
*
*
%
#4 "
" **
* *
,
-
.
Session
,
-
1
Session("User"P
*
.
0
#
!
0 ,@=
- *
( #
.
8
"
8
$
"
+
"
" /
/
4 *
"
+
"
1
(p
/ + "
' / 5
" "* "
+ #
8
(p
/ "
+ " # /
" +6+
(p
(p
p p / "
/6+"
"
#
.
* ( # "
(
" +
0
"
"
0
"
"
. !
" 8
7 * ( # 0
"
7
!8
6
0
. !8
* ( # 8
!8 E8
. !8
8"
. !8
+ 0 8.!8
8"
"
0
!8
7 " !8
!8
" +
.!
"
0 .
"
7 "
"
R N
"
0