FANDOM


Un visor de imágenes Editar

Primera versión Editar

Option Explicit On

Public Class frmVisor

 Private Sub frmVisor_Load( _
   ByVal sender As System.Object, _
   ByVal e As System.EventArgs _
 ) Handles MyBase.Load
   dlgAbrir.ShowDialog()
   picVisor.ImageLocation = dlgAbrir.FileName
   Text = dlgAbrir.FileName
 End Sub

End Class

Versión con botón Editar

Option Explicit On

Public Class frmVisor

 Private Sub SeleccionarImagen()
   dlgAbrir.ShowDialog()
   picVisor.ImageLocation = dlgAbrir.FileName
   Text = dlgAbrir.FileName
 End Sub
 Private Sub frmVisor_Load( _
   ByVal sender As System.Object, _
   ByVal e As System.EventArgs _
 ) Handles MyBase.Load
   SeleccionarImagen()
 End Sub
 Private Sub btnVisor_Click( _
   ByVal sender As System.Object, _
   ByVal e As System.EventArgs _
 ) Handles btnVisor.Click
   SeleccionarImagen()
 End Sub

End Class

Eventos Editar

Evento Click Editar

Option Explicit On

Public Class frmColores

 Private Sub btnVerColor_Click( _
   ByVal sender As System.Object, _
   ByVal e As System.EventArgs _
 ) Handles btnVerColor.Click
   picColores.BackColor = _
     Color.FromArgb( _
       tkbRojo.Value, _
       tkbVerde.Value, _
       tkbAzul.Value _
     )
 End Sub

End Class

Evento Scroll Editar

Public Class frmColores

 Sub CambiarColor()
   picColores.BackColor = _
     Color.FromArgb( _
       tkbRojo.Value, _
       tkbVerde.Value, _
       tkbAzul.Value _
     )
 End Sub
 Private Sub tkbRojo_Scroll( _
   ByVal sender As System.Object, _
   ByVal e As System.EventArgs _
 ) Handles tkbRojo.Scroll
   CambiarColor()
 End Sub
 Private Sub tkbVerde_Scroll( _
   ByVal sender As System.Object, _
   ByVal e As System.EventArgs _
 ) Handles tkbVerde.Scroll
   CambiarColor()
 End Sub
 Private Sub tkbAzul_Scroll( _
   ByVal sender As System.Object, _
   ByVal e As System.EventArgs _
 ) Handles tkbAzul.Scroll
   CambiarColor()
 End Sub

End Class

El contenido de la comunidad está disponible bajo CC-BY-SA a menos que se indique lo contrario.