domingo, 24 de janeiro de 2010

Ficha 19



Private Sub Command1_Click()

If Combo1 = "Classificação de triângulos" Then
Form2.Show
Form1.Hide
ElseIf Combo1 = "Classificação de circunferência" Then
Form3.Show
Form1.Hide
Else
x = MsgBox("Escolha uma Classificação..", vbOKOnly + vbInformation, "Form1")
End If

End Sub

Private Sub Command2_Click()

End

End Sub

Private Sub Form_Load()

Combo1.AddItem "Classificação de triângulos"
Combo1.AddItem "Classificação de circunferência"

End Sub

Private Sub Timer1_Timer()

Label1 = Time

End Sub




Private Sub cmd1_Click()

Dim a As Single, b As Single, c As Single, x As Single, y As Single, z As Single

x = Val(operA.Text)
y = Val(operB.Text)
z = Val(operC.Text)

If x > y And x > z Then
a = x
b = y
c = z
ElseIf y > x And y > z Then
a = y
b = x
c = z
ElseIf z > x And z > y Then
a = z
b = x
c = y
Else
a = x
b = y
c = z
End If


If a >= b + c Then
resultado.Caption = "Nenhum triângulo formado"
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = True

ElseIf a ^ 2 = b ^ 2 + c ^ 2 Then
resultado.Caption = "Triângulo retângulo"
Image1.Visible = True
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False

ElseIf a ^ 2 > b ^ 2 + c ^ 2 Then
resultado.Caption = "Triângulo obtusângulo"
Image1.Visible = False
Image2.Visible = True
Image3.Visible = False
Image4.Visible = False

ElseIf a ^ 2 < b ^ 2 + c ^ 2 Then
resultado.Caption = "Triângulo acutângulo"
Image1.Visible = False
Image2.Visible = False
Image3.Visible = True
Image4.Visible = False

End If

End Sub

Private Sub cmd2_Click()

Form2.Hide
Form1.Show

End Sub

Private Sub cmd3_Click()

End

End Sub




Private Sub Command1_Click()

Dim pontox As Integer, pontoy As Integer

Picture1.Cls
Label1.Caption = ""

pontox = Val(InputBox("Intoduza coordenada X", "Introdução de dados"))

Picture1.Print Tab(4); "X=" & pontox
pontoy = Val(InputBox("Introduza coordenada Y", "Introdução de dados"))

Picture1.Print Tab(4); "Y=" & pontoy

If (x - a) ^ 2 + (y - b) ^ 2 Then

Label1.Caption = ("O ponto introduzido é interior à circunferência de centro")

ElseIf (x - a) ^ 2 + (y - b) ^ 2 > r ^ 2 Then
Label1.Caption = ("O ponto introduzido é exterior à circuferencia de centro")

ElseIf (x - a) ^ 2 + (y - b) ^ 2 = r ^ 2 Then
Label1.Caption = ("O ponto introduzido é fronteiro à circuferencia de centro")

Else

MsgBox "Pontos inválidos!", vbOKOnly + vbInformation, "Informação"

End If


End Sub

Private Sub Command2_Click()

Form3.Hide
Form1.Show

End Sub

Private Sub Command3_Click()

End

End Sub

quinta-feira, 7 de janeiro de 2010

Ficha 18-2






Dim matriz(1 To 4, 1 To 3)
Private Sub cmd1_Click()

Dim funcionário As Integer, mes As Integer, cont As Integer, contf As Integer

cont = 0
contf = 1
Picture1.Print Tab(16); "Meses"
For funcionario = 1 To 4
Picture1.Print "Funcionário " & contf & Chr(32); Chr(26);
contf = contf + 1
For mes = 1 To 3
matriz(funcionario, mes) = Val(InputBox("Introduza a " & mes & "º venda do " & funcionario & "º funcionário", "Audi"))
Picture1.Print matriz(funcionario, mes);
cont = cont + 1
If cont = 3 Then
Picture1.Print Chr(13)
cont = 0
End If
Next mes
Next funcionario

cmd1.Enabled = False
cmd2.Enabled = True

End Sub

Private Sub cmd2_Click()

Dim consulta As Integer, soma As Integer, mes As Integer

soma = 0

consulta = Val(InputBox("Qual o total de vendas do Funcionário que vai querer consultar ?" & Chr(13) & "Funcionário 1, 2, 3 ou 4?", "Audi"))

If consulta > 0 And consulta < 5 Then
For mes = 1 To 3
soma = soma + matriz(consulta, mes)
Next mes
Else
erro = MsgBox("O número que introduziu ''" & consulta & "'' não corresponde a nenhum Funcionário" & Chr(13) & Chr(13) & "Por favor tente novamente", vbInformation + vbOKOnly, "Informação")
End If

If consulta > 0 And consulta < 5 Then

Picture2.Print "Funcionário consultado " & Chr(26) & Chr(32) & consulta
Picture2.Print Chr(13); soma
cmd1.Enabled = False
cmd2.Enabled = False
cmd3.Enabled = True
Else
Picture2.Print Chr(13); " erro "
cmd1.Enabled = False
cmd2.Enabled = False
cmd3.Enabled = False
End If

End Sub

Private Sub cmd3_Click()

Dim indice As Integer, total As Integer, funcionario As Integer, contf2 As Integer

total = 0
contf2 = 1

indice = Val(InputBox("Qual o mes de vendas que vai querer consultar ?" & Chr(13) & "Mês 1, 2 ou 3?", "Audi"))

Picture3.Print "Mês " & Chr(26) & Chr(32) & indice & Chr(13)
If indice > 0 And indice < 4 Then
For funcionario = 1 To 4
total = 0
total = total + matriz(funcionario, indice)
Picture3.Print "Funcionário " & contf2
contf2 = contf2 + 1
Picture3.Print Tab(5); total & Chr(13)
Next funcionario
Else
erro = MsgBox("O número que introduziu ''" & indice & "'' não corresponde a nenhum Funcionário" & Chr(13) & Chr(13) & "Por favor tente novamente", vbInformation + vbOKOnly, "Informação")
Picture3.Print "erro"
End If

cmd1.Enabled = False
cmd2.Enabled = False
cmd3.Enabled = False

End Sub

Private Sub cmd4_Click()

Picture1.Cls
Picture2.Cls
Picture3.Cls
cmd1.Enabled = True
cmd2.Enabled = False

End Sub

Private Sub cmd5_Click()

End

End Sub

Ficha 18-1




Dim matriz(1 To 4, 1 To 3) As Integer

Private Sub Gerar_Click()

Dim linha As Integer, coluna As Integer, cont As Integer

Randomize

For linha = 1 To 4
For coluna = 1 To 3
matriz(linha, coluna) = Int(Rnd() * 100)
Picture1.Print matriz(linha, coluna);
cont = cont + 1
If cont = 3 Then
Picture1.Print Chr(13)
cont = 0
End If
Next coluna
Next linha

Somar.Enabled = True
Gerar.Enabled = False
Limpar.Enabled = True

End Sub

Private Sub Somar_Click()
Dim consulta As Integer, soma As Integer, linha As Integer

soma = 0

consulta = Val(InputBox("Qual a coluna que vai querer consultar ?" & Chr(13) & "Coluna 1, Coluna 2 ou Coluna 3?", "Coluna"))

If consulta > 0 And consulta < 4 Then
For linha = 1 To 4
soma = soma + matriz(linha, consulta)
Next linha
Else
erro = MsgBox("O número que introduziu ''" & consulta & "'' não é o correcto" & Chr(13) & Chr(13) & "Por favor tente novamente", vbInformation + vbOKOnly, "Informação")
End If

If consulta > 0 And consulta < 4 Then
Picture2.Print Chr(13); Tab(5); soma
Else
Picture2.Print Chr(13); Tab(5); " erro"
End If

Gerar.Enabled = False
Somar.Enabled = False

End Sub

Private Sub Limpar_Click()

Picture1.Cls
Picture2.Cls
Gerar.Enabled = True
Somar.Enabled = False
Limpar.Enabled = False

End Sub

Private Sub Sair_Click()

End

End Sub

quinta-feira, 17 de dezembro de 2009

Ficha 17-5



Private Sub Timer1_Timer()

Lbltime.Caption = Now()

End Sub

Function FU_Delay(Quanto As Double, PermiteDoEvents As Integer) As Double

Dim inicio As Double
Dim Check As Double
Dim Contador As Double
Contador = Timer
inicio = Timer
Do Until Check >= (inicio + Quanto)
Check = Timer
If PermiteDoEvents Then DoEvents
Loop

FU_Delay = (Timer - Contador)
End Function

Private Sub Form_Load()
Form3.Show
Form2.Hide
If res = sair Then
r = FU_Delay(3, True)
Beep
End
End If
End Sub




Private Sub Command1_Click()
Image1.Visible = True
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
Image13.Visible = False
Image14.Visible = False
Image15.Visible = False
Image16.Visible = False
Image17.Visible = False
Image18.Visible = False
End Sub

Private Sub Command10_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = True
Image11.Visible = False
Image12.Visible = False
Image13.Visible = False
Image14.Visible = False
Image15.Visible = False
Image16.Visible = False
Image17.Visible = False
Image18.Visible = False
End Sub

Private Sub Command11_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = True
Image12.Visible = False
Image13.Visible = False
Image14.Visible = False
Image15.Visible = False
Image16.Visible = False
Image17.Visible = False
Image18.Visible = False
End Sub

Private Sub Command12_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = True
Image13.Visible = False
Image14.Visible = False
Image15.Visible = False
Image16.Visible = False
Image17.Visible = False
Image18.Visible = False
End Sub

Private Sub Command13_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
Image13.Visible = True
Image14.Visible = False
Image15.Visible = False
Image16.Visible = False
Image17.Visible = False
Image18.Visible = False
End Sub

Private Sub Command14_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
Image13.Visible = False
Image14.Visible = True
Image15.Visible = False
Image16.Visible = False
Image17.Visible = False
Image18.Visible = False
End Sub

Private Sub Command15_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
Image13.Visible = False
Image14.Visible = False
Image15.Visible = True
Image16.Visible = False
Image17.Visible = False
Image18.Visible = False
End Sub

Private Sub Command16_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
Image13.Visible = False
Image14.Visible = False
Image15.Visible = False
Image16.Visible = True
Image17.Visible = False
Image18.Visible = False
End Sub

Private Sub Command17_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
Image13.Visible = False
Image14.Visible = False
Image15.Visible = False
Image16.Visible = False
Image17.Visible = True
Image18.Visible = False
End Sub

Private Sub Command18_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
Image13.Visible = False
Image14.Visible = False
Image15.Visible = False
Image16.Visible = False
Image17.Visible = False
Image18.Visible = True
End Sub

Private Sub Command19_Click()

Form1.Show
Form4.Hide

End Sub

Private Sub Command2_Click()
Image1.Visible = False
Image2.Visible = True
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
Image13.Visible = False
Image14.Visible = False
Image15.Visible = False
Image16.Visible = False
Image17.Visible = False
Image18.Visible = False
End Sub

Private Sub Command20_Click()
Dim confirmacao As Integer

confirmacao = MsgBox("Pretende mesmo sair?", vbYesNo + vbQuestion, "Deutsch-Fraktion - Confirmação")

If confirmacao = vbYes Then
Form3.Show
Form4.Hide
Else
End If

End Sub

Private Sub Command3_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = True
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
Image13.Visible = False
Image14.Visible = False
Image15.Visible = False
Image16.Visible = False
Image17.Visible = False
Image18.Visible = False
End Sub

Private Sub Command4_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = True
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
Image13.Visible = False
Image14.Visible = False
Image15.Visible = False
Image16.Visible = False
Image17.Visible = False
Image18.Visible = False
End Sub

Private Sub Command5_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = True
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
Image13.Visible = False
Image14.Visible = False
Image15.Visible = False
Image16.Visible = False
Image17.Visible = False
Image18.Visible = False
End Sub

Private Sub Command6_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = True
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
Image13.Visible = False
Image14.Visible = False
Image15.Visible = False
Image16.Visible = False
Image17.Visible = False
Image18.Visible = False
End Sub

Private Sub Command7_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = True
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
Image13.Visible = False
Image14.Visible = False
Image15.Visible = False
Image16.Visible = False
Image17.Visible = False
Image18.Visible = False
End Sub

Private Sub Command8_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = True
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
Image13.Visible = False
Image14.Visible = False
Image15.Visible = False
Image16.Visible = False
Image17.Visible = False
Image18.Visible = False
End Sub

Private Sub Command9_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = True
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False
Image13.Visible = False
Image14.Visible = False
Image15.Visible = False
Image16.Visible = False
Image17.Visible = False
Image18.Visible = False
End Sub




Private Sub cmd1_Click()

Dim matriz(1 To 3, 1 To 4), vendedor As Integer, trimestre As Integer, cont As Integer
Dim soma As Integer, i As Integer, total As Integer, total2 As Integer
Dim totalvendedor(1 To 3) As Integer, totaltrimestre(1 To 4) As Integer

cont = 0
total = 0
total2 = 0

' Preenchimento da matriz com números introduzidos pelo utilizador

For vendedor = 1 To 3
If vendedor = 1 Then
tipo = "Audi"
End If
If vendedor = 2 Then
tipo = "BMW"
End If
If vendedor = 3 Then
tipo = "Mercedes-Benz"
End If
Picture1.Print tipo
Picture1.Print "||";
For trimestre = 1 To 4
matriz(vendedor, trimestre) = Val(InputBox("Introduza as vendas da " & tipo & " no " & trimestre & "º Trimestre", "Notas"))
Picture1.Print matriz(vendedor, trimestre); "||";
cont = cont + 1
soma = soma + matriz(vendedor, trimestre)
If cont = 4 Then
Picture1.Print Chr(13);
cont = 0
End If
Next trimestre
Next vendedor

' Pesquisa do total de vendas de cada vendedor

For vendedor = 1 To 3
total2 = 0
For trimestre = 1 To 4
total = total + matriz(vendedor, trimestre)
total2 = total2 + matriz(vendedor, trimestre)
Next trimestre
If vendedor = 1 Then
tipo = "Audi"
End If
If vendedor = 2 Then
tipo = "BMW"
End If
If vendedor = 3 Then
tipo = "Mercedes-Benz"
End If
totalvendedor(vendedor) = total2
Picture2.Print "Venda de automóveis " & tipo & " -> " & totalvendedor(vendedor) & " unidades vendidas."
Next vendedor

' Pesquisa do total de vendas de cada trimestre

For trimestre = 1 To 4
total2 = 0
For vendedor = 1 To 3
total2 = total2 + matriz(vendedor, trimestre)
Next vendedor
totaltrimestre(trimestre) = total2
Picture3.Print trimestre & "ºtrimestre " & totaltrimestre(trimestre)
Next trimestre

Picture4.Print "O total de vendas das 3 marcas de automóveis -> " & soma & " unidades vendidas num ano."

cmd1.Enabled = False

End Sub

Private Sub Command1_Click()

Form1.Show
Form2.Hide

End Sub

Private Sub sair_click()
Dim confirmacao As Integer

confirmacao = MsgBox("Pretende mesmo sair?", vbYesNo + vbQuestion, "Deutsch-Fraktion - Confirmação")

If confirmacao = vbYes Then
Form3.Show
Form2.Hide
Else
End If

End Sub





Private Sub Command1_Click()

Form2.Show
Form1.Hide

End Sub

Private Sub Command2_Click()

Form4.Show
Form1.Hide

End Sub

Private Sub sair_click()
Dim confirmacao As Integer

confirmacao = MsgBox("Pretende sair?", vbYesNo + vbQuestion, "Deutsch-Fraktion - Confirmação")

If confirmacao = vbYes Then
Form3.Show
Form2.Hide
Else
End If

End Sub

quarta-feira, 16 de dezembro de 2009

Ficha 17-4



Private Sub cmd1_Click()

Dim matriz(1 To 4, 1 To 4), linha As Integer, coluna As Integer, cont As Integer
Dim vetA(1 To 4) As Integer, vetB(1 To 4) As Integer

Picture1.Cls
Picture2.Cls
Picture3.Cls
cont = 0

Randomize

For linha = 1 To 4
For coluna = 1 To 4
matriz(linha, coluna) = Int(Rnd() * 10)
Picture1.Print matriz(linha, coluna);
cont = cont + 1
If cont = 4 Then
Picture1.Print Chr(13)
cont = 0
End If
Next coluna
Next linha

For linha = 1 To 4
vetA(linha) = 0
For coluna = 1 To 4
If matriz(linha, coluna) > vetA(linha) Then
vetA(linha) = matriz(linha, coluna)
End If
Next coluna
Next linha

For coluna = 1 To 4
vetB(coluna) = 10
For linha = 1 To 4
If matriz(linha, coluna) < vetB(coluna) Then
vetB(coluna) = matriz(linha, coluna)
End If
Next linha
Next coluna

For linha = 1 To 4
Picture2.Print vetA(linha); Chr(13)
Picture3.Print vetB(linha);
Next linha

cmd1.Enabled = False
cmd2.Enabled = True

End Sub

Private Sub cmd2_Click()

Picture1.Cls
Picture2.Cls
Picture3.Cls
cmd1.Enabled = True
cmd2.Enabled = False

End Sub

Private Sub cmd3_Click()

Beep
End

End Sub

domingo, 13 de dezembro de 2009

Ficha 17-3



Private Sub cmd1_Click()

Dim matriz(1 To 5, 1 To 3), aluno As Integer, nota As Integer, cont As Integer
Dim maior As Integer, positiva As Integer, negativa As Integer, superior As Integer

cont = 0
positiva = 0
negativa = 0
superior = 0

For aluno = 1 To 5
For nota = 1 To 3
matriz(aluno, nota) = Val(InputBox("Introduza a " & nota & "º nota e " & aluno & "º aluno", "Notas"))
Picture1.Print matriz(aluno, nota);
cont = cont + 1
If cont = 3 Then
Picture1.Print Chr(13)
cont = 0
End If
If nota = 1 Then
If matriz(aluno, nota) < 10 Then
negativa = negativa + 1
End If
End If
If nota = 2 Then
If matriz(aluno, nota) > 9 Then
positiva = positiva + 1
End If
End If
If nota = 3 Then
If matriz(aluno, nota) > 16 Then
superior = superior + 1
End If
End If
Next nota
Next aluno

Picture2.Print "Alunos com nota negativa na 1ª prova -> " & negativa
Picture2.Print "Alunos com positiva na 2ª prova -> " & positiva
Picture2.Print "Alunos com nota superior a 16 na 3ª prova -> " & superior

cmd1.Enabled = False
cmd2.Enabled = True

End Sub


Private Sub cmd2_Click()

Picture1.Cls
Picture2.Cls
cmd1.Enabled = True
cmd2.Enabled = False

End Sub

Private Sub cmd3_Click()
End
End Sub

Ficha 17-2





Private Sub cmd1_Click()

Dim matriz(1 To 3, 1 To 5), linha As Integer, coluna As Integer, cont As Integer
Dim maior As Integer, par As Integer, impar As Integer, zero As Integer

cont = 0

For linha = 1 To 3
For coluna = 1 To 5
matriz(linha, coluna) = Val(InputBox("Introduza o número da " & linha & "º linha e " & coluna & "º coluna", "Inserir Valores"))
If matriz(linha, coluna) <= 25 And matriz(linha, coluna) >= 0 Then
Picture1.Print matriz(linha, coluna);
cont = cont + 1
If cont = 5 Then
Picture1.Print Chr(13)
cont = 0
End If
If matriz(linha, coluna) = 0 Then
zero = zero + 1
End If
If matriz(linha, coluna) Mod 2 = 0 Then
par = par + 1
If matriz(linha, coluna) = 0 Then
par = par - 1
End If
End If
If matriz(linha, coluna) Mod 2 = 1 Then
impar = impar + 1
End If
Else
If matriz(linha, coluna) < 0 Then
MsgBox "O número que introduziu era inferior a 0", vbOKOnly + vbInformation, "Inserir Valores"
linha = 3
coluna = 5
Picture1.Cls
zero = 0
par = 0
impar = 0
ElseIf matriz(linha, coluna) > 25 Then
MsgBox "O número que introduziu era superior a 25", vbOKOnly + vbInformation, "Inserir Valores"
linha = 3
coluna = 5
Picture1.Cls
zero = 0
par = 0
impar = 0
End If
End If
Next coluna
Next linha

cmd1.Enabled = False
cmd2.Enabled = True

Picture2.Print "Número de ''0'' introduzidos -> " & zero
Picture2.Print "Números pares introduzidos -> " & par
Picture2.Print "Números impares introduzidos -> " & impar

If zero = 0 And par = 0 And impar = 0 Then
Picture1.Cls
Picture2.Cls
cmd1.Enabled = True
cmd2.Enabled = False
End If

End Sub

Private Sub cmd2_Click()

Picture1.Cls
Picture2.Cls
cmd1.Enabled = True
cmd2.Enabled = False

End Sub

Private Sub cmd3_Click()
End
End Sub