Ver Mensaje Individual
  #11 (permalink)  
Antiguo 28/05/2010, 05:14
Avatar de Atorort
Atorort
 
Fecha de Ingreso: abril-2010
Ubicación: Valencia
Mensajes: 127
Antigüedad: 14 años
Puntos: 0
Respuesta: Listbox y el doble click..

A ver...si me podeis ayudar a resolver esto, este es el código que intento implementar:
He creado un botón con la propiedad visible a 'False' tal y como dice en la página anterior.

Código ASP:
Ver original
  1. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  2.         If Not IsPostBack Then
  3.             conn.Open()
  4.             Dim postBackReferenceForListBox As String
  5.             'Page.GetPostBackClientEvent(btnForListBoxDoubleClick, "dblClickfromHiddenButton")
  6.             ClientScript.GetPostBackEventReference(btnForListBoxDoubleClick, "dblClickfromHiddenButton")
  7.             lstusuarios.Attributes.Add("ondblclick", postBackReferenceForListBox)
  8.         End If
  9.     End Sub
  10.  
  11.  
  12.     Protected Sub btnForListBoxDoubleClick_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnForListBoxDoubleClick.Click
  13.         Dim argumento As String = Request.Params("__EVENTARGUMENT")
  14.         Trim(argumento)
  15.  
  16.         If argumento = "dblClickfromHiddenButton" Then
  17.             Try
  18.                 For Each aItem As ListItem In lstusuarios.Items
  19.                     If aItem.Selected = True Then
  20.                         txtreceptor.Text &= aItem.Text + ", "
  21.                     End If
  22.                 Next
  23.  
  24.             Catch ex As Exception
  25.             End Try
  26.         End If
  27.     End Sub
__________________
Adrian Tornero Ortiz
Técnico Superior en Desarrollo de Aplicaciones Informáticas
https://www.linkedin.com/in/adriantornero