FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
Agregar ID a checkboxlist en delphi
Holas
Este es el codigo para agregar CheckListBox dinamico pero a este codigo quiero agregar el Id por checkbox y asi depues hacer el recorrido de la lista de checkbox ..por favor me podrian indicar como ahcer la sintaxis para agregar el ID de cada checkbox....eh buscado en google y no eh encontrado gracias por su respuesta.
|
#2
|
||||
|
||||
Hola teecweb.
No entiendo a que te refieres con "ID". Si es a la posición que ocupa el ítem actual, la podes obtener mediante la propiedad ItemIndex:
En cambio si "ID" se refiere al campo de un DataSet, un ejemplo para cargar un campo de texto y el campo "ID" :
Para obtener el valor: (en el ejemplo se muestra)
Saludos.
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... Última edición por ecfisa fecha: 03-03-2013 a las 20:45:15. |
#3
|
|||
|
|||
Click en cada uno de los checkbox devolver el text
Holas..gracias por surespuesta
con respecto a tu primer codigo..devuelve el indice de los checbox en un checkboxlist:
lo eh agregrado asi en la funcion de onclick por checbox:
por ejemplo mi for para la creacion de checkbolist que se encuentra arriba ..devuelve asi [checkbox] = es la casilla de checkbox [checkbox]'aaaaa' [checkbox]'aaaaa' [checkbox]'aaaaa' [checkbox]'aaaaa' [checkbox]'aaaaa' Entonces cada vez que hago click a mi funcion uninstaller me deberia devolver la posicion de los checkboxlist por MsgBox : 0 1 2 3 4 pero en cambio me devuelve asi segun el codigo que usted me envio:
-1 -1 -1 -1 0 En realidad llevo una 2semana en el lenguaje delphi ..por favor alguna solucion Tambien quisiera saber cual es el codigo para retornar el text de los checkbox al hacer click en cada uno de ellos..gracias por su respuesta..estare al tanto |
#4
|
||||
|
||||
Hola teecweb.
No cuál sea el contenido del TCheckListBox, pero basta con que realices esta simple prueba en una nueva aplicación para comprobar que la propiedad ItemIndex devuelve el valor del índice actual: Es decir que si el CheckListBox tiene algún contenido, el código: mostrará el índice actualmente seleccionado. Lo que podría suceder es que no estés llamándo el código en el evento OnClick del TCheckListBox, en ese caso sí es necesario comprobar el valor de la propiedad ItemIndex:
Saludos.
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... |
#5
|
|||
|
|||
ok, muchas gracias estare probando el codigo
|
#6
|
|||
|
|||
Asi creo mi control de checkbolist..el codigo es para un instalador inno setup y innosetup utiliza el pascal que es parecido al delphi bueno es lo que segun investigue
ya eh probado el codigo que usted me mando..y lo eh hecho asi como esta arriba..aun asi me bota el index -1..gracias por su pronta respuesta...En el codigo que me envio hay eventos asi 'TForm1.FormCreate' en inno setup no se genera estos eventos . |
#7
|
||||
|
||||
teecweb,
Cita:
Revisa este código: El código anterior devuelve el índice de cada elemento de un control TCheckListBox en un control TListBox. Revisa este código: El código anterior devuelve el índice de un elemento seleccionado del control TCheckListBox por medio del evento OnClick. Revisa este código: Este código es una variante más simple del anterior por medio del evento OnClick. Los códigos anteriores funcionan en Delphi, quizás funcionen de forma similar en Inno Setup y se puedan adaptar a tu Instalador. Espero sea útil Nelson. Última edición por nlsgarcia fecha: 04-03-2013 a las 05:27:39. |
#8
|
||||
|
||||
Hola teecweb.
Mi respuesta fué por el título de tu primer mensaje "Agregar ID a checkboxlist en delphi", pero tratándose de Inno setup cambia un poco la cosa. Nunca había realizado un script para Inno setup, pero basándome en parte en tu código y revisando un poco aquí: Pascal Scripting: Support Classes Reference, hice unas pruebas y en este ejemplo se muestran el texto y los índices de los items seleccionados en el TNewChekListBox como respuesta del evento OnClick de Buttona: Espero te oriente para lograr lo que estás buscando. Saludos.
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... |
#9
|
|||
|
|||
Gracias por sus respuestas estare probando el codigo
|
#10
|
|||
|
|||
Holas si ya funciono.gracias...pero quisiera hacer una consulta mas:
Una vez que ya recorrio bien los indices y recuperar los nombres de los check se procede a desistalar : por ejemplo la lista que se recorre: c:\Program Files\rcv1.1\ c:\Program Files\rcv1.2\ //procedimiento para desistalacion los .exe existentes ***********Mi dificultad es cuando shellexec se ejecuta ya sea para una desistalacion correcta o incorrecta sale del bucle y vuelve a recorrer el bucle..y yo en realidad no necesito que salga del bucle sino que siga con el siguiente indice.. si algo fallo en la desistalacion sale el error y sino ejecuta normalmente y el bucle empieza denuevo y cuando el bucle empieza denuevo ahi es mi dificultad porque necesito que normalmente siga el bucle y no salga de el
por favor si hay alguna suegerencia estare muy pendiente..gracias por sus respuestas |
#11
|
||||
|
||||
teecweb,
Cita:
Revisa este código: El código anterior recorre el arreglo de Items del control TCheckListbox y por cada item seleccionado llama al procedimiento DesistalarItem El cambio de ShellExec por Exec esta basado en la información de este link: http://www.jrsoftware.org/ishelp/ind...=scriptclasses Nota: Este código no esta probado en Inno Setup. Espero sea útil Nelson. Última edición por nlsgarcia fecha: 05-03-2013 a las 05:08:23. |
#12
|
|||
|
|||
gracias por su respuesta probare el codigo..
|
#13
|
|||
|
|||
Funciono perfectamente !!..gracias
|
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Recorrer checkboxlist en pascal para un realizar en INNOSETUP | teecweb | Varios | 1 | 02-03-2013 07:23:48 |
Agregar mas colores de fuente a Delphi | candylolz | OOP | 5 | 07-08-2012 16:37:55 |
Agregar una linea en uses en delphi 10 | piruchin | Varios | 3 | 11-04-2011 12:57:24 |
Agregar componente Delphi 8 | elaprendizprog | Impresión | 4 | 20-03-2009 18:11:23 |
Agregar sonido en Delphi | jescar | .NET | 2 | 17-09-2006 08:30:04 |
|