elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


  Mostrar Mensajes
Páginas: 1 ... 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 [887] 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 ... 1253
8861  Informática / Software / Re: Hacer portable un programa ya instalado?? en: 28 Junio 2013, 21:26 pm
El programa es phpDesigner8

En este caso es un programa muy sencillo, no crea ninguna clave de registro (bueno, la crea vacía, asi que nada)

Tienes uan carpeta en "%APPDATA%\phpdesigner"
Otra carpeta en "%PROGRAMFILES%\phpDesigner 8"

..Y nada más, con copiar eso es suficiente.

Saludos!
8862  Informática / Software / Re: Hacer portable un programa ya instalado?? en: 28 Junio 2013, 21:18 pm
...Cada programa es un mundo, si no dices de que programa se trata dudo que se te pueda ayudar más que diciendote esto:

1. Monitoriza el registro en busca de nuevas claves añadidas durante la instalación.
2. Monitoriza los archivos en busca de nuevos archivos expandidos durante la instalación.
3. Recopíla todas esas claves y archivos para crear tu portable.

No me vale lo de "es que ya lo tengo instalado", como ya digo cada programa es un mundo, y ese programa puede tener 1.000 archivos expandidos por las carpetas del sistema y que sin ellos no podrás ejecutar la aplicación, por eso has de monitorizar esos archivos, además puede tener servicios, dll's registradas en el sistema, de todo vaya.

Si dices tener una aplicaicón que ya monitoriza todo eso por ti durante la instalación, pues entonces eso es lo que necesitas.

..Ahora, si se trata de un programa sencillo, pues es suficiente con copiar el contenido del directorio de la aplicación, y hacer tu portable, con Winrar por ejemplo (para newbies).

Saludos!
8863  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 28 Junio 2013, 18:27 pm
Un ListView extendido para monitorizar cuando se añade y cuando se elimina un Item.

MUY IMPORTANTE: Hay que utilizar los nuevos métodos (AddItem, RemoveItem) en lugar de usar el antiguo ...items.Add o ...items.Remove, para que funcione.

PD: Si alguien sabe como overridearlos de forma correcta que lo diga :P

Código
  1. '  /*                  *\
  2. ' |#* ListView Elektro *#|
  3. '  \*                  */
  4. '
  5. ' // By Elektro H@cker
  6. '
  7. '   Properties:
  8. '   ...........
  9. ' · Disable_Flickering
  10. ' · Double_Buffer
  11. '
  12. '   Events:
  13. '   .......
  14. ' · ItemAdded
  15. ' · ItemRemoved
  16. '
  17. '   Methods:
  18. '   .......
  19. ' · AddItem
  20. ' · RemoveItem
  21.  
  22. Public Class ListView_Elektro : Inherits ListView
  23.  
  24.    Public Event ItemAdded()
  25.    Public Event ItemRemoved()
  26.  
  27.    Private _Disable_Flickering As Boolean = True
  28.  
  29.    Public Sub New()
  30.        Me.Name = "ListView_Elektro"
  31.        Me.DoubleBuffered = True
  32.        ' Me.GridLines = True
  33.        ' Me.MultiSelect = True
  34.        ' Me.FullRowSelect = True
  35.        ' Me.View = View.Details
  36.    End Sub
  37.  
  38. #Region " Properties "
  39.  
  40.    ''' <summary>
  41.    ''' Enable/Disable any flickering effect on the ListView.
  42.    ''' </summary>
  43.    Protected Overrides ReadOnly Property CreateParams() As CreateParams
  44.        Get
  45.            If _Disable_Flickering Then
  46.                Dim cp As CreateParams = MyBase.CreateParams
  47.                cp.ExStyle = cp.ExStyle Or &H2000000
  48.                Return cp
  49.            Else
  50.                Return MyBase.CreateParams
  51.            End If
  52.        End Get
  53.    End Property
  54.  
  55.    ''' <summary>
  56.    ''' Set the Double Buffer.
  57.    ''' </summary>
  58.    Public Property Double_Buffer() As Boolean
  59.        Get
  60.            Return Me.DoubleBuffered
  61.        End Get
  62.        Set(ByVal Value As Boolean)
  63.            Me.DoubleBuffered = Value
  64.        End Set
  65.    End Property
  66.  
  67.    ''' <summary>
  68.    ''' Enable/Disable the flickering effects on this ListView.
  69.    '''
  70.    ''' This property turns off any Flicker effect on the ListView
  71.    ''' ...but also reduces the performance (speed) of the ListView about 30% slower.
  72.    ''' This don't affect to the performance of the application itself, only to the performance of this control.
  73.    ''' </summary>
  74.    Public Property Disable_Flickering() As Boolean
  75.        Get
  76.            Return _Disable_Flickering
  77.        End Get
  78.        Set(ByVal Value As Boolean)
  79.            Me._Disable_Flickering = Value
  80.        End Set
  81.    End Property
  82.  
  83. #End Region
  84.  
  85. #Region " Methods "
  86.  
  87.    ''' <summary>
  88.    ''' Add an item to the ListView.
  89.    ''' </summary>
  90.    Public Function AddItem(ByVal Text As String) As ListViewItem
  91.        RaiseEvent ItemAdded()
  92.        Return MyBase.Items.Add(Text)
  93.    End Function
  94.  
  95.    ''' <summary>
  96.    ''' Remove an item from the ListView.
  97.    ''' </summary>
  98.    Public Sub RemoveItem(ByVal Item As ListViewItem)
  99.        RaiseEvent ItemRemoved()
  100.        MyBase.Items.Remove(Item)
  101.    End Sub
  102.  
  103. #End Region
  104.  
  105. End Class


Ejemplo de uso:

Código
  1. #Region " [ListView Elektro] Monitor Item added-removed "
  2.  
  3.    ' [ListView Elektro] Monitor Item added-removed
  4.    '
  5.    ' // By Elektro H@cker
  6.  
  7.        Private Sub Main_Load(sender As Object, e As EventArgs) Handles MyBase.Shown
  8.           Dim Item As ListViewItem = ListView1.AddItem("Test") ' Add the item
  9.           ListView1.RemoveItem(Item) ' Remove the item
  10.       End Sub
  11.  
  12.       Private Sub ListView_ItemChanged() Handles ListView1.ItemAdded, ListView1.ItemRemoved
  13.  
  14.           ' I check if exists at least 1 item inside the ListView
  15.           If ListView1.Items.Count <> 1 Then MsgBox("Listview have items.") Else MsgBox("Listview is empty.")
  16.  
  17.       End Sub
  18.  
  19. #End Region
8864  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 28 Junio 2013, 17:03 pm
A ti te dejan doble postear? >:(

No lo considero doble-postear, posteo cuando tengo un nuevo snippet o una cantidad de snippets, a veces me los creo/consigo de 1 en 1 o de 5 en 5, nunca se sabe...

PD: A mi no me trollees xD



¿En la del listview no se puede hacer listview.items.indexof("txt")? ¿o utiliza algún tipo de encapsulación distinta al string cada item?

El ...IndexOf("text") rquiere pasarle un "ListiewItem", no he podido pasarle un string para probar.

PD: A ver si consigues mejorarlo tu :P

un saludo!
8865  Programación / .NET (C#, VB.NET, ASP) / Re: Dar margin a un texto dentro de un TextBox? en: 28 Junio 2013, 16:55 pm
Pero que no quiero alinear nada... además si se pudiese alinear verticalmente como en los Labeles... :P

pues prueba a hacerlo multiline y le añades un vbnewline y luego el texto

EDITO: O mejor aún... adapta el tamaño del textbox al tamaño de la fuente, y listo.
8866  Programación / .NET (C#, VB.NET, ASP) / Re: Dar margin a un texto dentro de un TextBox? en: 28 Junio 2013, 16:49 pm
Como ves donde está el texto que pone mi nombre, está muy pegado al borde del TextBox, por no decir que está junto. ;)
Eso quiero separarlo. :P

. . .

Lee las propiedades del textbox, pero no busques por "margen" sinó por "alinear"

Edito: También influye en el margen que tipo de borde estés usando "borderstyle", y bueno... el margen opcional se lo puedes añadir con espacios.

saludos!
8867  Programación / .NET (C#, VB.NET, ASP) / Re: Dar margin a un texto dentro de un TextBox? en: 28 Junio 2013, 16:31 pm
Dar margin a un texto dentro de un TextBox?

puedes explicarlo mejor? que tipo de margen? algun ejemplo de como es tu texto y como debería ser? ...
8868  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 28 Junio 2013, 16:30 pm
[Textbox] Show end part of text

Este snippet no se muy bien como explicarlo en pocas palabras, así que lo voy a explicar con imágenes...

Cuando excedemos el límite visible del textbox, la parte del final, es decir la parte derecha no se muestra:



Pues con este snippet omitiremos la parte de la izquierda, mostrando hasta la parte final del texto:



Código
  1.    Private Sub TextBox_TextChanged(sender As Object, e As EventArgs) _
  2.    Handles TextBox1.TextChanged
  3.  
  4.        ' If the text reaches the writable box size then this shows the end part of the text.                                                          
  5.        sender.Select(sender.TextLength, sender.TextLength)
  6.  
  7.    End Sub

Saludos!
8869  Programación / .NET (C#, VB.NET, ASP) / Re: Insertar <Script> en VB.NET en: 28 Junio 2013, 16:18 pm
Añado: Además lo del html 5 solo funcionará si en el equipo se dispone de iexplorer 9 o superior (creo que el soporte para HTML 5 empezaba desde la versión ie9, corregirme si me equivoco).

EDITO: sería más factible hardcodearlo, ¿no?, un par de trackbars y de botones, y listo!

Saludos!
8870  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 28 Junio 2013, 12:34 pm
Función para comprobar si un ListView contiene cierto texto:

PD: La verdad es que no es muy útil a menos que le añada más opciones, la hice porque muchas veces se me olvida el nombre del método "FindItemWithText" y eso me hace perder tiempo :silbar:

Código
  1. #Region " Find ListView Text "
  2.  
  3.    ' [ Find ListView Text Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    ' MsgBox(Find_ListView_Text(ListView1, "Hello"))
  9.    ' If Find_ListView_Text(ListView1, "Hello") Then...
  10.  
  11.    Private Function Find_ListView_Text(ByVal ListView As ListView, ByVal Text As String) As Boolean
  12.        Try : Return Convert.ToBoolean(ListView.FindItemWithText(Text)) : Catch : Return True : End Try
  13.    End Function
  14.  
  15. #End Region

Ejemplo de uso:

Código
  1.    Private Sub Status_Timer_Tick(sender As Object, e As EventArgs) Handles Status_Timer.Tick
  2.  
  3.        If Find_ListView_Text(ListView1, TextBox_Filename.Text) Then
  4.            Label_Status.Text = "Current song found"
  5.        Else
  6.            Label_Status.Text = "Current song not found"
  7.        End If
  8.  
  9.    End Sub
Páginas: 1 ... 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 [887] 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 ... 1253
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines