Jump to content

[RESOLVIDO]picturebox


Tiago fernando

Recommended Posts

óla pessoal eu sou novo nisto de programar, como disse anteriormente em outro tópico eu estou a fazer um catálogo para os meus cds e dvds.

Vamos ao que interessa eu tenho uma picture box com imagens de uma base de dados e queria criar um botão ou algo do genero que fize-se com que a imagem amplia-se.

valeu 😉

Link to comment
Share on other sites

Insere uma picturebox no teu projecto e 2 butões, com o nome dos 3 objectos por default

e copia e passa o seguinte código:

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        PictureBox1.Size = New System.Drawing.Size((PictureBox1.Size.Width + 20), (PictureBox1.Size.Height + 10))
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        PictureBox1.ImageLocation = "http://www.portugal-a-programar.org/forum/Themes/saf-mc1/images/pap.jpg"
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        PictureBox1.Size = New System.Drawing.Size((PictureBox1.Size.Width - 20), (PictureBox1.Size.Height - 10))
    End Sub
End Class

E pronto está aí 😉

Melhores cumprimentos,João Lopes***Esta mensagem foi escrita ao abrigo do novo Acordo Ortográfico***

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.