Sección vb.net
Volver - Anterior - Siguiente
Contenido :
Averiguar si hay una imagen
Establecer y obtener una imagen en el portapapeles
Saber si hay texto almacenado
Saber si hay archivos
Obtener los archivos del clipboard
Colocar o establecer ficheros
Eliminar el contenido
Leer y guardar texto plano
guardar un sonido
Option Explicit On Public Class Form1 Private Sub Form1_Load( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load If My.Computer.Clipboard.ContainsImage() = True Then MsgBox("Contiene imagen") Else MsgBox("No Contiene imagen") End If End Sub End Class
Option Explicit On Imports System.Windows.Forms.SendKeys Public Class Form1 Private Sub Form1_Load( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load With My.Computer.Clipboard ' envía la pulsación de la tecla print screen SendKeys.Send("{PRTSC}") ' recupera la imagen Me.BackgroundImage = .GetImage() End With End Sub End Class
Option Explicit On Public Class Form1 Private Sub Form1_Load( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load If My.Computer.Clipboard.ContainsText() = True Then MsgBox("Hay texto") Else MsgBox("No hay texto") End If End Sub End Class
Option Explicit On Public Class Form1 Private Sub Form1_Load( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load If My.Computer.Clipboard.ContainsFileDropList() = True Then MsgBox("Hay archivos") Else MsgBox("No hay archivos") End If End Sub End Class
Option Explicit On Imports System.Collections.Specialized Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles MyBase.Load Dim lista As StringCollection Dim sArchivos As String = "" ' verifica si hay archivos If Clipboard.ContainsFileDropList Then 'obtiene lista = Clipboard.GetFileDropList ListBox1.Items.Clear() ' los agrega al listbox For Each sArchivos In lista ListBox1.Items.Add(sArchivos).ToString() Next End If End Sub End Class
Option Explicit On Imports System.Collections.Specialized Imports System.IO.File Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles MyBase.Load Dim sFile1 As String = "c:\archivo1.txt" Dim sFile2 As String = "c:\archivo2.txt" Dim lista As New StringCollection Try ' verifica si existen If Exists(sFile1) And Exists(sFile2) Then ' Los agrega a la lista lista.Add(sFile1) lista.Add(sFile2) ' los establece Clipboard.SetFileDropList(lista) Else MsgBox("La ruta de los archivos no es válida", _ MsgBoxStyle.Critical) End If Catch mensaje As Exception MsgBox(mensaje.Message) End Try End Sub End Class
Option Explicit On Public Class Form1 Private Sub Form1_Load( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load My.Computer.Clipboard.Clear() End Sub End Class
Option Explicit On Public Class Form1 Private Sub Form1_Load( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load My.Computer.Clipboard.SetText("un texto", TextDataFormat.Text) MsgBox(My.Computer.Clipboard.GetText()) End Sub End Class
Option Explicit On Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles MyBase.Load Dim Musica As Byte() Musica = My.Computer.FileSystem.ReadAllBytes("cool.wav") My.Computer.Clipboard.SetAudio(Musica) End Sub End Class
Buscar en Recursos vb
Recursos visual basic - Buscar - Privacidad - Copyright © 2005 - 2008 - www.recursosvisualbasic.com.ar