FTP | CCD | Buscar | Trucos | Trabajo | Foros |
#1
|
||||
|
||||
Bloquear Edits
buenos dias
tengo esta rutina para bloquear edit dentro de un formulario
la pregunta es... como bloquear otros componentes que no sean edit, como por ejemplo datetimepicker que pregunta debe ir en el if ??? como identifico "el origen" del componente ?
__________________
Dulce Regalo que Satanas manda para mi..... |
#2
|
||||
|
||||
Hola
Puedes cambiar la comprobacion de TEdit a Twincontrol. Saludos
__________________
Caminante, son tus huellas el camino y nada más; Caminante, no hay camino, se hace camino al andar. Antonio Machado |
#3
|
|||
|
|||
hola
El tema es que la herencia en un TDateTimePicker es asi: Código:
TDateTimePicker = class(TCommonCalendar) --> TCommonCalendar = class(TWinControl) y salvo el TWinControl no tiene nada mas en común con respecto a los TEdit / TDBEdit Código:
TEdit = class(TCustomEdit) --> TCustomEdit = class(TWinControl) TDBEdit = class(TCustomMaskEdit) --> TCustomMaskEdit = class(TCustomEdit) --> TCustomEdit = class(TWinControl) Otra opción es buscar solamente los que quieres desabilitar:
|
#4
|
||||
|
||||
Hola Oscar.
Fijate si te sirve de este modo:
Ej. de uso:
Saludos
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... Última edición por ecfisa fecha: 19-03-2019 a las 17:54:45. Razón: corrección |
#5
|
||||
|
||||
Cita:
__________________
Dulce Regalo que Satanas manda para mi..... |
#6
|
||||
|
||||
Cita:
respecto a este ejemplo me aperece este mensaje de error Cita:
la pregunta es, como saber que tipo de componente es el componente actual (de la lista de componentes en el form), para saber si lo deshabilito o no
__________________
Dulce Regalo que Satanas manda para mi..... |
#7
|
||||
|
||||
Hola de nuevo.
Cita:
Para el control actual podrías usar:
Pero, al tener que mantener activo mas de un botón ('Cancelar' y 'Eliminar'), seguramente te sirva de este modo:
Saludos
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... Última edición por ecfisa fecha: 19-03-2019 a las 18:58:24. |
#8
|
||||
|
||||
Como llevo cierto orden al nombrar los controles lo solucione de esta manera
__________________
Dulce Regalo que Satanas manda para mi..... |
#9
|
||||
|
||||
Otra opción es parametrizar las clases que quieres deshabilitar. Eso sí, deben ser todos los de las clases especificadas. Con esta opción no puedes escoger unos TEdit si y otros no.
Algo así:
De forma que puedes llamarlo así:
__________________
Germán Estévez => Web/Blog Guía de estilo, Guía alternativa Utiliza TAG's en tus mensajes. Contactar con el Clubdelphi P.D: Más tiempo dedicado a la pregunta=Mejores respuestas. |
#10
|
||||
|
||||
También, dependiendo de cómo se organice ell formulario, se pueden poner los controles que se deshabiltan dentro de un contenedor común (Panel o Groupbox p. ej.) y deshabilitar el contenedor.
// Saludos |
#11
|
||||
|
||||
Cita:
Esta me parece una solucion muy interesante, puesto que yo tendria el control de lo que quiero deshabilitar muchas gracias
__________________
Dulce Regalo que Satanas manda para mi..... |
#12
|
|||
|
|||
Amigo otro opción es hacer uso de las RTTI...Hace unos años recopile unos procedimientos para realizar esta tarea en un desarrollo.
Te adjunto la unidad y un ejemplo. Espero te ayude. Es solo otra opción de realizar lo que requieres...
Ejemplo: Un formulario y varios componentes...
Saludos cordiales |
#13
|
||||
|
||||
interesante, lo tendré en cuenta gracias
__________________
Dulce Regalo que Satanas manda para mi..... |
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
sumar edits | Kamael | OOP | 17 | 12-03-2015 19:18:55 |
Validar edits | lucas05 | Varios | 3 | 29-11-2011 15:40:54 |
filtrar edits | pabloloustau | Varios | 4 | 26-03-2010 07:04:35 |
forms y edits | Rolando | Varios | 2 | 30-09-2003 23:46:02 |
Edits | aitken | Varios | 7 | 06-05-2003 14:51:08 |
|