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

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  FullRowSelect
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: FullRowSelect  (Leído 1,440 veces)
skyweb07

Desconectado Desconectado

Mensajes: 122


The ghost of the network


Ver Perfil
FullRowSelect
« en: 12 Octubre 2008, 16:23 pm »

Hola chicos, estaba tratando ponerle a un LV (Microsoft Windows Common Control 5.0) la opción de FullRowSelect pero veo que esta no trae esta opción y quiero ponersela a este ya que estoy usando el estilo XP y el LV del control Microsoft Windows Common Control 6.0 no acepta este estilo por lo que necesito ponerselo al listview, porfa necesito que me ayuden!! Gracias de antemano!!!!!!!!!!


En línea

TUNOVATO

Desconectado Desconectado

Mensajes: 56


Ver Perfil
Re: FullRowSelect
« Respuesta #1 en: 12 Octubre 2008, 17:23 pm »

saludos compa..!!

espero te sirva de ayuda...

Ejemplo paso a paso:

1. Inicie un proyecto nuevo EXE estándar. Se creará Form1 de manera predeterminada 
2. Seleccionar componentes en el menú Proyecto. Haga clic en la casilla de verificación al lado de "Microsoft controles comunes de Windows 5.0" y a continuación, haga clic en Aceptar. 
3. Agregue a Form1 un control ListView (ListView1). 
4. Agregue a Form1 un CommandButton (Command1). 
5. Agregue el código siguiente al módulo de Formulario:
 
Código:
Private Declare Function SendMessage Lib "user32" Alias _
        "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal _
        wParam As Long, lParam As Any) As Long

      Const LVS_EX_FULLROWSELECT = &H20
      Const LVM_FIRST = &H1000
      Const LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + &H37
      Const LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + &H36

      Private Sub Command1_Click()
        Dim lStyle As Long
        lStyle = SendMessage(ListView1.hwnd, _
           LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
        lStyle = lStyle Or LVS_EX_FULLROWSELECT
        Call SendMessage(ListView1.hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, _
           0, ByVal lStyle)
      End Sub

      Private Sub Form_Load()
        'Add two Column Headers to the ListView control
        Set clmAdd = ListView1.ColumnHeaders.Add(Text:="Name")
        Set clmAdd = ListView1.ColumnHeaders.Add(Text:="Date")

        'Set the view property of the Listview control to Report view
        ListView1.View = lvwReport

        'Add data to the ListView control
        Set itmAdd = ListView1.ListItems.Add(Text:="Joe")
        itmAdd.SubItems(1) = "05/07/97"

        Set itmAdd = ListView1.ListItems.Add(Text:="Sally")
        itmAdd.SubItems(1) = "04/08/97"

        Set itmAdd = ListView1.ListItems.Add(Text:="Bill")
        itmAdd.SubItems(1) = "05/29/97"

        Set itmAdd = ListView1.ListItems.Add(Text:="Fred")
        itmAdd.SubItems(1) = "05/17/97"

        Set itmAdd = ListView1.ListItems.Add(Text:="Anne")
        itmAdd.SubItems(1) = "04/01/97"
      End Sub

nota: sacado de: http://support.microsoft.com/kb/181440


segunda opcion:


en un modulo (*.BAS)
Código:
Option Explicit

Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
   (ByVal hwnd As Long, _
    ByVal Msg As Long, _
    ByVal wParam As Long, _
    lParam As Any) As Long

Public Const LVM_FIRST = &H1000
Public Const LVM_SETEXTENDEDLISTVIEWSTYLE = (LVM_FIRST + 54)
Public Const LVM_GETEXTENDEDLISTVIEWSTYLE = (LVM_FIRST + 55)

Public Const LVS_EX_FULLROWSELECT = &H20



en el form usa un Check1

Código:
Option Explicit

Private Sub Check1_Click()

   Dim state As Long
 
  'state will be true when the checkbox
  'style is 1 (checked) or False when
  'unchecked
   state = Check1.Value = 1
 
  'set the new listview style
   Call SendMessage(ListView1.hwnd, _
                        LVM_SETEXTENDEDLISTVIEWSTYLE, _
                        LVS_EX_FULLROWSELECT, ByVal state)

End Sub

nota: sacado de: http://vbnet.mvps.org/index.html?code/comctl/lvfullrowselect.htm

espero que te sirva de guia....


En línea

skyweb07

Desconectado Desconectado

Mensajes: 122


The ghost of the network


Ver Perfil
Re: FullRowSelect
« Respuesta #2 en: 12 Octubre 2008, 17:42 pm »

Man muchas gracias me ha servido de mucho !!!!Cuidate!!!!!!!xDDDDDDDDDDDD :laugh:
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines