Autor
|
Tema: Librería de Snippets para VB.NET !! (Compartan aquí sus snippets) (Leído 543,478 veces)
|
Eleкtro
Ex-Staff
Desconectado
Mensajes: 9.891
|
Unos snippets que hice para usarlos con ListViews: - Auto scrollea un Listview hasta el último Item.
' Scroll ListView Private Sub Scroll_ListView(ByVal ListView_Name As ListView) ListView_Name.EnsureVisible(ListView_Name.Items.Count - 1) End Sub
- Deshabilita el menú contextual si no hay ningún Item seleccionado.
' [ListView] Auto-Disable ContextMenu Private Sub ContextMenu_Opening(sender As System.Object, e As System.ComponentModel.CancelEventArgs) _ Handles Listview1_ContextMenu.Opening If ListView1.SelectedItems.Count = 0 Then e.Cancel = True End Sub
- Copia el contenido de un Item al portapapeles
#Region " [ListView] Copy Item To Clipboard " ' [ [ListView] Copy Item To Clipboard ] ' ' // By Elektro H@cker ' ' Examples : ' ' Copy_Selected_Items_To_Clipboard(ListView1, 0) ' Copies Item 0 ' Copy_Selected_Items_To_Clipboard(ListView1, 0, 2) ' Copies SubItem 2 of Item 0 Private Sub Copy_Item_To_Clipboard(ByVal ListView_Name As ListView, _ ByVal Item As Int32, _ Optional ByVal SubItem As Int64 = 0) Clipboard.SetText(ListView_Name.Items(Item).SubItems(SubItem).Text) End Sub #End Region
- Copia el contenido de los items seleccionados al portapapeles
#Region " [ListView] Copy Selected-Items To Clipboard " ' [ [ListView] Copy Selected-Items To Clipboard ] ' ' // By Elektro H@cker ' ' Examples : ' ' Copy_Selected_Items_To_Clipboard(ListView1) ' Copies all SubItems of selected Items ' Copy_Selected_Items_To_Clipboard(ListView1, 2) ' Copies only SubItem 2 of selected Items Private Sub Copy_Selected_Items_To_Clipboard(ByVal ListView_Name As ListView, _ Optional ByVal SubItem As Int32 = -0) Dim text As String = String.Empty For Each Entry As ListViewItem In ListView_Name.SelectedItems() If SubItem = -0 Then For Each Subi As ListViewItem.ListViewSubItem In ListView_Name.Items(Entry.Index).SubItems text &= " " & Subi.Text Next text &= ControlChars.NewLine Else text &= ControlChars.NewLine & ListView_Name.Items(Entry.Index).SubItems(SubItem).Text End If Next Clipboard.SetText(text) End Sub #End Region
|
|
|
En línea
|
|
|
|
z3nth10n
Desconectado
Mensajes: 1.583
"Jack of all trades, master of none." - Zenthion
|
Mini aporte, muy mini xDComo escribir en varias líneas a través de .Text de un Control Label, TextBox, etc.Label1.Text = "Texto por aquí" & vbCrLf 'Este texto representa un Salto de Línea >:D & "Texto por acá xD"
Un saludo. Advertencia - mientras estabas escribiendo, una nueva respuesta fue publicada....Joer! Que puntería tienes! xD Tema: Librería de Snippets !! (Posteen aquí sus snippets) (Leído 10,100 veces)Anda! 10k de visitas! Enhorabuena 
|
|
« Última modificación: 16 Junio 2013, 19:49 pm por Ikillnukes »
|
En línea
|
⏩ Interesados hablad por Discord.
|
|
|
Eleкtro
Ex-Staff
Desconectado
Mensajes: 9.891
|
Abre un archivo o una carpeta en el explorador de Windows #Region " Open In Explorer " ' [ Open In Explorer ] ' ' // By Elektro H@cker ' ' Examples : ' Open_In_Explorer("C:\Folder\") ' Open_In_Explorer("C:\Folder\File.txt") Private Sub Open_In_Explorer(ByVal File_Or_Folder As String) If File_Or_Folder.EndsWith("\") Then File_Or_Folder = File_Or_Folder.Substring(0, File_Or_Folder.Length - 1) If IO.Directory.Exists(File_Or_Folder) Then Dim FileInformation As IO.FileInfo = My.Computer.FileSystem.GetFileInfo(File_Or_Folder) Process.Start("explorer.exe", " /select," & IO.Path.Combine(FileInformation.DirectoryName, FileInformation.Name)) ElseIf IO. File. Exists(File_Or_Folder ) Then Dim FolderInformation As IO.DirectoryInfo = My.Computer.FileSystem.GetDirectoryInfo(File_Or_Folder) Process.Start("explorer.exe ", FolderInformation.FullName) Else Throw New Exception(File_Or_Folder & " doesn't exist") End If End Sub #End Region
Abre un dialogo y selecciona un proceso para ejecutar un archivo. #Region " Open With... " ' [ Open With... ] ' ' // By Elektro H@cker ' ' Examples : ' Open_With("C:\File.txt") ' And select "Notepad.exe" in the Dialog... Private Sub Open_With(ByVal File_Or_Folder As String) Dim OpenWith As New OpenFileDialog() OpenWith.InitialDirectory = Environ("programfiles") OpenWith.Title = "Open file with..." OpenWith.Filter = "Application|*.exe" If OpenWith.ShowDialog() = DialogResult.OK Then Process.Start(OpenWith.FileName, " " & """" & File_Or_Folder & """") End If End Sub #End Region
|
|
|
En línea
|
|
|
|
|
z3nth10n
Desconectado
Mensajes: 1.583
"Jack of all trades, master of none." - Zenthion
|
Un poco ratas si que hay que ser. xD Aparte de tu y yo, quien más ha participado? 
|
|
|
En línea
|
⏩ Interesados hablad por Discord.
|
|
|
Eleкtro
Ex-Staff
Desconectado
Mensajes: 9.891
|
Aparte de tu y yo, quien más ha participado?  ABDERRAMAH
|
|
|
En línea
|
|
|
|
z3nth10n
Desconectado
Mensajes: 1.583
"Jack of all trades, master of none." - Zenthion
|
ABDERRAMAH
Y cuantos Snippets ha dejado?  Me he fijado y NovLucker también ha ayudado. 
|
|
|
En línea
|
⏩ Interesados hablad por Discord.
|
|
|
Eleкtro
Ex-Staff
Desconectado
Mensajes: 9.891
|
Me he fijado y NovLucker también ha ayudado.  Si leyeras sin prisas verías que NovLucker no ha aportado Snippets porque él no tiene Snippets (Como dijo en los comentarios del principio de este hilo), símplemente comentó para ayudarme a intentar perfeccionar la manera en la que yo codeaba las cosas. Saludos
|
|
« Última modificación: 16 Junio 2013, 20:15 pm por EleKtro H@cker »
|
En línea
|
|
|
|
z3nth10n
Desconectado
Mensajes: 1.583
"Jack of all trades, master of none." - Zenthion
|
xD Me refería a que ha ayudado a perfeccionar. (Se ha que ha ayudao, es más he leido algunos de sus comentarios  )  xD Hijo estás muy ofuscao xD Saludos!
|
|
|
En línea
|
⏩ Interesados hablad por Discord.
|
|
|
Eleкtro
Ex-Staff
Desconectado
Mensajes: 9.891
|
Hijo estás muy ofuscao xD Si, es lo que pasa cuando me ofuscan. Saludos
|
|
|
En línea
|
|
|
|
|
Mensajes similares |
|
Asunto |
Iniciado por |
Respuestas |
Vistas |
Último mensaje |
|
|
Librería de Snippets en C/C++
« 1 2 3 4 »
Programación C/C++
|
z3nth10n
|
31
|
26,825
|
2 Agosto 2013, 17:13 pm
por 0xDani
|
|
|
[APORTE] [VBS] Snippets para manipular reglas de bloqueo del firewall de Windows
Scripting
|
Eleкtro
|
1
|
4,197
|
3 Febrero 2014, 20:19 pm
por Eleкtro
|
|
|
Librería de Snippets para Delphi
« 1 2 »
Programación General
|
crack81
|
15
|
21,988
|
25 Marzo 2016, 18:39 pm
por crack81
|
|
|
Una organización en Github para subir, proyectos, snippets y otros?
Sugerencias y dudas sobre el Foro
|
z3nth10n
|
0
|
3,185
|
21 Febrero 2017, 10:47 am
por z3nth10n
|
|
|
índice de la Librería de Snippets para VB.NET !!
.NET (C#, VB.NET, ASP)
|
Eleкtro
|
7
|
6,723
|
4 Julio 2018, 21:35 pm
por Eleкtro
|
|