quinta-feira, 6 de junho de 2013

Reflexão global

Este Modulo fala sobre classes, foi um modulo importante na aprendizagem de classes. Eu colocei os objectos deste modulo, o que são classes, classes derivadas e colocei o um programa como exemplo.
Programa do Hospital 

Parte Gráfica
Parte do Código

Public Class form1
    Dim r1 As New medico
    Dim r2 As New assistente
    Dim r3 As New pessoalauxiliar
    Dim r4 As New limpeza
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        r1.nomep = InputBox("Introduza o nome do médico")
        r1.idadep = InputBox("idade")
        r1.moradap = InputBox("morada")
        r1.telemp = InputBox("telemóvel")
        r1.especilidadep = InputBox("especialidade")
        r1.bip = InputBox("CARTAO DE CIDADAO")
        r1.turnop = InputBox("Turno")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        r2.nomep = InputBox("Introduza o nome do médico")
        r2.idadep = InputBox("idade")
        r2.moradap = InputBox("morada")
        r2.telemp = InputBox("telemóvel")
        r2.tipop = InputBox("tipo")
        r2.bip = InputBox("CARTAO DE CIDADAO")
        r2.turnop = InputBox("Turno")
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        r3.nomep = InputBox("Introduza o nome do médico")
        r3.idadep = InputBox("idade")
        r3.moradap = InputBox("morada")
        r3.telemp = InputBox("telemóvel")
        r3.especilidadep = InputBox("especialidade")
        r3.bip = InputBox("CARTAO DE CIDADAO")
        r3.turnop = InputBox("Turno")
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

        r4.nomep = InputBox("Introduza o nome do médico")
        r4.idadep = InputBox("idade")
        r4.moradap = InputBox("morada")
        r4.telemp = InputBox("telemóvel")
        r4.tipop = InputBox("especialidade")
        r4.bip = InputBox("CARTAO DE CIDADAO")
        r4.seccaop = InputBox("Turno")
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Label2.Text = ("nome:" & r1.nomep)
        Label3.Text = ("idade:" & r1.idadep)
        Label4.Text = r1.moradap
        Label5.Text = r1.telemp
        Label6.Text = r1.bip
        Label7.Text = r1.especilidadep
        Label8.Text = r1.turnop
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Label2.Text = r2.nomep
        Label3.Text = r2.idadep
        Label4.Text = r2.moradap
        Label5.Text = r2.telemp
        Label6.Text = r2.bip
        Label7.Text = r2.tipop
        Label8.Text = r2.turnop
    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        Label2.Text = r3.nomep
        Label3.Text = r3.idadep
        Label4.Text = r3.moradap
        Label5.Text = r3.telemp
        Label6.Text = r3.bip
        Label7.Text = r3.especilidadep
        Label8.Text = r3.turnop
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        Label2.Text = r4.nomep
        Label3.Text = r4.idadep
        Label4.Text = r4.moradap
        Label5.Text = r4.telemp()
        Label6.Text = r4.bip
        Label7.Text = r4.tipop
        Label8.Text = r4.seccaop
    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        Dim y As Integer
        y = MsgBox("deseja mesmo sair", MsgBoxStyle.YesNo)
        If y = vbYes Then
            Close()
        End If
    End Sub

    Private Sub form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class

Reflexão: Este é um programa(Hospital) que faz a inscrição de uma fixa  e pede o nome, a idade entra varias coisas.Eu escolhi este programa porque tem class derivadas e acho que é um bom exemplo para colocar no e-portefólio.


Classes derivadas




Reflexão:  Está aqui um exemplo de uma classe derivada, com a função predefinida chamada inherits, que vai chamar todos os campos da class base.Por isso vai ter os campos da class base e do médico.

segunda-feira, 3 de junho de 2013

Classes e Propriedades



Reflexão: Esta aqui um exemplo de um programa com dois campos(Nome e dataN) privados e usei a propriedade "Public Property " para aceder aos campos privados colocados.
Classes

Uma classe é uma unidade de código que reúne ao mesmo tempo:

-> Membros de dados ou atributos
->Métodos(Procedimentos e/ou funções)

Exemplo de uma criação de uma classe:

Class Rectângulo
Public Comprimento as Single
Public Largura as Single
  Public Function area() as Single
          Return Comprimento * Largura 
  End function
End class


Reflexão:  Achei crucial colocar um exemplo de uma class pois é a matéria que nos estamos a dar, pois eu achei  importante colocar isto:








Modulo 11

Classes e Componentes

Objectivos do modulo 11:

-> Criar e utilizar correctamente classes
-> Criar e utilizar correctamente objectos
-> Criar classes derivadas de outros objectos
-> Criar e utilizar bibliotecas de classes
-> Conhecer diferentes tipos de componentes
-> Criar e instalar um componente  do tipo User Control 
-> Gerir bibliotecas de classes e componentes 

terça-feira, 28 de maio de 2013

Reflexão global

Este módulo  consistiu na Programação Orientada a Objectos, foi um módulo importante na aprendizagem de criação  no visual basic, na criação de Funções e Procedimentos e como declarar e utilizar vectores unidimensionais e bidimensionais, aprendemos de decisão if...then, select case, as estruturas de repetição do...loop, while  e for...next.  

sexta-feira, 3 de maio de 2013

Programa do Euromilhões 

Parte Gráfica do programa
1->


 Adicionei novo item que se chama module

Parte Código:

Module Calculo
    Dim a As Integer
    Sub geraAleatorio(ByRef v() As Integer)
        Randomize()
        Form1.lsteuro.Items.Clear()
        For i = 0 To 6
            v(i) = Int(Rnd() * 50 + 1)
            Form1.lsteuro.Items.Add(v(i))
        Next
    End Sub
    Function MaiorNumero(ByVal x() As Integer)
        Dim maior As Integer
        maior = x(0)
        For i = 1 To 6
            If x(i) > maior Then
                maior = x(i)
            End If
        Next
        MaiorNumero = maior
    End Function
    Function MenorNumero(ByVal x() As Integer)
        Dim menor As Integer
        menor = x(0)
        For i = 1 To 6
            If x(i) < menor Then
                menor = x(i)
            End If
        Next
        MenorNumero = menor
    End Function
    Sub pp(ByRef palpite() As Integer)
        For i = 0 To 6
            palpite(i) = InputBox("Palpite " & i + 1, "Palpites")
            verifica1(palpite, i)
            verifica2(palpite, i)
            Form1.ListBox1.Items.Add(palpite(i))

        Next
    End Sub
    Sub verifica1(ByRef v() As Integer, ByRef indice As Integer)
        Do Until ((v(indice) >= 1) And (v(indice) <= 50))
            v(indice) = InputBox("Palpite " & indice + 1, "Palpites")
        Loop
    End Sub
    Sub verifica2(ByRef v() As Integer, ByRef indice As Integer)
        Dim val As Boolean
        Val = False
        Do Until val
            val = True
            For i = 0 To indice - 1
                If v(i) = v(indice) Then
                    v(indice) = InputBox("Palpite " & indice + 1, "Palpites")
                    val = False
                End If
            Next
        Loop
    End Sub
End Module

Form1:

Public Class Form1
    Dim opalpite(6) As Integer
    Dim x(6) As Integer
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        For i = 0 To 6
            x(i) = Nothing
        Next
    End Sub

    Private Sub btngerar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btngerar.Click
        geraAleatorio(x)
    End Sub

    Private Sub btnmaior_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnmaior.Click
        MsgBox("Maior Número " & MaiorNumero(x), MsgBoxStyle.OkOnly, "Maior")
    End Sub

    Private Sub btnmenor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnmenor.Click
        MsgBox("Menor Número " & MenorNumero(x), MsgBoxStyle.OkOnly, "Menor")
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim y As Integer
        y = MsgBox("Quer mesmo sair?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Sair")
        If y = vbYes Then
            Close()
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlimpar.Click
        lsteuro.Items.Clear()
        ListBox1.Items.Clear()
    End Sub

    Private Sub ordenar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnordenar.Click
        lsteuro.Items.Clear()
        Array.Sort(x)
        For i = 0 To 6
            lsteuro.Items.Add(x(i))
        Next
    End Sub



terça-feira, 16 de abril de 2013


Estrutura de repetição - For... Next


For contador = v_inicial to v_final [Step p]
   <bloco de instruções>
Next

Estrutura de repetição - While


While <condição>
   <instruções>
End While


Estrutura de repetição - Do... Loop

Do 
   <instruções>
Loop While / Until <condição>

ou 

Do While / Until <condição>
   <instruções>
Loop



Estrutura de decisão - Select Case

Select Case <expressão>

Case <lista_de_valores_1>
   <bloco_de_instruções_1>
[Case <lista_de_valores_2>
   <bloco_de_instruções_2>]
...

[Case Else
   <bloco_de_instruções_N>]
End Select

Por Exemplo:

Select Case i
            Case 1, 3, 5, 7, 8, 10, 12
                MsgBox("Esse mês tem 31 dias", vbOKOnly, "ficha01")
            Case 2
                MsgBox("Ano Bissexto", vbQuestion + vbYesNo, "ficha01")
                If   i = vbYes Then
                    MsgBox("Esse mês tem 29 dias", vbOKOnly, "ficha01")
                Else
                    MsgBox("Esse mês tem 28 dias", vbOKOnly, "ficha01")
                End If
            Case Else
                MsgBox("Esse mês tem 30 dias", vbOKOnly, "ficha01")
        End Select


Estrutura de decisão - if ...then ..


If <condição> then
     <instruções>
[Else lf <Condição> then
     <condição>]
[Else
     <Intrudoção>
End if

Por Exemplo: 

if Nota < 10 Then
    MsgBox(“Reprovado”)
Else
    MsgBox(“Aprovado”)
End if

sexta-feira, 5 de abril de 2013

Modulo 10 -> Programação orientada a objectos

Neste módulo no que diz respeito as estruturas de decisão, como por exemplo as estrutura "If...Then...[Else]" e também e estrutura "Select Case...[Else]".Achei interessante a matéria porque eu acho que as estruturas estavam esquecidas.

sexta-feira, 1 de março de 2013

Reflexão global

Neste módulo 9 abordamos o tema no que diz respeito ao "Ambiente de programação orientada por objectos", e foi trabalhado no programa"visual basic".

Contudo, neste módulo demos um grande avanço na programação, pois não só trabalhamos com o código em si, mas também com o “designer gráfico”, o que fez com que tudo se torna-se mais interessante para mim.
Eu gostei muito deste modulo.




Neste módulo 9 abordamos o tema no que diz respeito ao “Ambiente de Programação Orientada por Objetos)”, e foi trabalhado no programa “Visual Basic”.
Reflexão da ficha ->5

Eu escolhi este programa porque aprendi funções novas como por exemplo mathround, int(roun) entre outras, e foi por isso por causa das funções que eu meti este  programa
Ficha ->7
Parte Gráfica


Código

Public Class Form1

    Private Sub Label8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label8.Click

    End Sub

    Private Sub TextBox9_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox9.TextChanged

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox9.Text = (Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text))
        TextBox14.Text = (Val(TextBox15.Text) + Val(TextBox16.Text) + Val(TextBox17.Text))
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Dim x As Integer
        x = MsgBox("Quer mesmo sair?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Exames")
        If x = vbYes Then
            Close()
        End If
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
        TextBox6.Text = ""
        TextBox7.Text = ""
        TextBox8.Text = ""
        TextBox9.Text = ""
        TextBox10.Text = ""
        TextBox11.Text = ""
        TextBox12.Text = ""
        TextBox13.Text = ""
        TextBox14.Text = ""
        TextBox15.Text = ""
        TextBox16.Text = ""
        TextBox17.Text = ""
        TextBox6.Focus()

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim maior, maior1 As Integer
        maior = Val(TextBox6.Text)

        If Val(TextBox7.Text) > maior Then
            maior = Val(TextBox7.Text)
        End If
        If Val(TextBox8.Text) > maior Then
            maior = Val(TextBox8.Text)
        End If
        TextBox10.Text = maior

        maior1 = Val(TextBox17.Text)
        If Val(TextBox16.Text) > maior1 Then
            maior1 = Val(TextBox16.Text)

        End If
        If Val(TextBox15.Text) > maior1 Then
            maior1 = Val(TextBox15.Text)
        End If
        TextBox13.Text = maior1

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim menor, menor1 As Integer
        menor = Val(TextBox6.Text)

        If Val(TextBox7.Text) < menor Then
            menor = Val(TextBox7.Text)
        End If
        If Val(TextBox8.Text) < menor Then
            menor = Val(TextBox8.Text)
        End If
        TextBox11.Text = menor

        menor1 = Val(TextBox17.Text)
        If Val(TextBox16.Text) < menor1 Then
            menor1 = Val(TextBox16.Text)

        End If
        If Val(TextBox15.Text) < menor1 Then
            menor1 = Val(TextBox15.Text)
        End If
        TextBox12.Text = menor1

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        If TextBox9.Text >= 10 Then
            Label17.Text = "Aprovado"
        Else
            Label17.Text = "Reprovado"
        End If
        If TextBox14.Text >= 10 Then
            Label18.Text = "Aprovado"
        Else
            Label18.Text = "Reprovado"
        End If
        If TextBox9.Text >= 10 And TextBox11.Text >= 10 Then
            MsgBox("Parabéns!!! Está aprovado.", MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, "Exames")
        End If
    End Sub

End Class



Ficha -> 6
Parte Gráfica


Código

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Label18.Text = (Val(TextBox1.Text) + Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text) + Val(TextBox5.Text) + Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text) + Val(TextBox9.Text) + Val(TextBox10.Text) + Val(TextBox11.Text) + Val(TextBox12.Text))
        Label19.Text = (Val(TextBox1.Text) + Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text) + Val(TextBox5.Text) + Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text) + Val(TextBox9.Text) + Val(TextBox10.Text) + Val(TextBox11.Text) + Val(TextBox12.Text)) / 12
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Close()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Label18.Text = ""
        Label19.Text = ""
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
        TextBox6.Text = ""
        TextBox7.Text = ""
        TextBox8.Text = ""
        TextBox9.Text = ""
        TextBox10.Text = ""
        TextBox11.Text = ""
        TextBox12.Text = ""
    End Sub
End Class



quinta-feira, 28 de fevereiro de 2013

Ficha -> 9

Parte gráfica


código


Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Randomize()
        PictureBox1.Visible = False
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Label1.Text = Int(Rnd(10) * 10)
        Label2.Text = Int(Rnd(10) * 10)
        Label3.Text = Int(Rnd(10) * 10)
        If Label1.Text = 7 Or Label2.Text = 7 Or Label3.Text = 7 Then
            PictureBox1.Visible = True
            Label4.Visible = True
            Beep()
            If Label1.Text = 7 And Label2.Text = 7 And Label3.Text = 7 Then
                MsgBox(" ganhou 500 euros ")
            ElseIf (Label1.Text = 7 And Label2.Text = 7) Or (Label1.Text = 7 And Label3.Text = 7) Or (Label2.Text = 7 And Label3.Text = 7) Then
                MsgBox(" ganhou 200 euros ")
            Else
                MsgBox(" ganhou 100 euros ")
            End If
            PictureBox1.Visible = False
            Label4.Visible = False
            Label1.Text = ""
            Label2.Text = ""
            Label3.Text = ""
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim x As Integer
        x = MsgBox("quer mesmo sair?", MsgBoxStyle.YesNo, " sair ")
        If x = vbYes Then
            Close()
        End If
    End Sub
End Class
ficha -> 8

 Parte gráfica


código

<Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox3.Text = LCase(TextBox1.Text)
        TextBox2.Text = UCase(TextBox1.Text)
        TextBox4.Text = Len(TextBox1.Text)
        Dim i As Integer
        For i = 1 To Len(TextBox1.Text)
            ListBox1.Items.Add(Mid(TextBox1.Text, i, 1))
        Next
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        TextBox1.Text = " "
        TextBox2.Text = " "
        TextBox3.Text = " "
        TextBox4.Text = " "
        ListBox1.Items.Clear()
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim x As Integer
        x = MsgBox("Quer mesmo sair", MsgBoxStyle.YesNo)
        If x = vbYes Then
            Close()
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        ListBox1.Items.Remove(ListBox1.SelectedItem)
    End Sub


End Class

quinta-feira, 21 de fevereiro de 2013

Ficha -> 5

Parte Gráfica



Parte do Código

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim x As Single
        x = Val(TextBox1.Text)
        TextBox3.Text = Math.Sqrt(x)
        Label7.Text = " Permite obter a parte inteira de um número "
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim x As Single
        x = Val(TextBox1.Text)
        TextBox3.Text = Int(x)
        Label7.Text = " Permite obter a parte inteira de um número "
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim x As Single
        x = Val(TextBox1.Text)
        TextBox3.Text = Math.Round(x, 2)
        Label7.Text = " Arredonda valores decimais num número especificado de casas"
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim x As Single
        x = Val(TextBox1.Text)
        TextBox3.Text = Int(Rnd() * 10) + 1
        Label7.Text = " Permite gerar número aleatórios "
    End Sub


    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        Dim x As Single
        x = Val(TextBox1.Text)
        TextBox3.Text = Format(x, "0.000")
        Label7.Text = " Permite a formação de valores "
    End Sub

    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
        Label4.Text = Today()
        Label5.Text = TimeOfDay()
        Label7.Text = " Permite mostrar a data e hora actual "

    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        TextBox3.Text = Len(TextBox2.Text)
        Label7.Text = " Permite contar o número de caracteres numa string "
    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        TextBox3.Text = InStr(TextBox2.Text, " ")
        Label7.Text = " Permite localizar uma porção de texto ou uma caracter numa string "
    End Sub

    Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
        TextBox3.Text = Trim(TextBox2.Text)
        Label7.Text = " Permite retirar todos os espaços do inicio edo final de uma string"


    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        TextBox3.Text = UCase(TextBox2.Text)
        Label7.Text = " permite converter todas as letras da string para Maíusculas "

    End Sub

    
    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        TextBox3.Text = LCase(TextBox2.Text)
        Label7.Text = "permite converter todas as letras da string para as minisculas"
    End Sub

    Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
        Dim x As Single
        x = Val(TextBox1.Text)
        TextBox3.Text = " determinar o valor  absoluto do número especificado "
    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        TextBox3.Text = Microsoft.VisualBasic.Left(TextBox2.Text, 4)
        Label7.Text = " obtem o nº especificado de caracters a partir da esquerda "
    End Sub

    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        TextBox3.Text = Microsoft.VisualBasic.Left(TextBox2.Text, 4)
        Label7.Text = " obtem o nº especificado de caracters a partir da direita "
    End Sub

    Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
        TextBox3.Text = Mid(TextBox2.Text, 4, 2)
        Label7.Text = " obtem o nº especificado de caracters a partir de uma posição "
    End Sub

    Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox1.Focus()
    End Sub

    Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click
        Dim x As String
        x = MsgBox("quer mesmo sair", MsgBoxStyle.YesNo)
        If x = vbYes Then
            Close()
        End If
    End Sub




sexta-feira, 11 de janeiro de 2013


Visual Basic(Programação Orientada a Objectos)

De entre os ambientes de programação desse tipo actualmente existentes, o Visual Basic apresenta as seguintes vantagens:
 -é de obtenção gratuita, na versão express;
 -é dos mais fáceis de utilizar;
 -é muito potente e completamente integrado no ambiente Windows.