Ayuda Boton Siguiente...
Hola, Acabo De Registrarme En El Foro Y Es Que Tengo Una Inquietud, Estoy Desarrollando Una Aplicacion En Delphi Para Impartir Examenes, Tengo Un Form Y He Colocado Conjuntos De Preguntas En Panels Y Tengo El Siguiente Inconveniente, Coloque Un Boton Siguiente Y Otro Anterior Para Cambiar Al Siguiente Bloque De Preguntas, Osea Al Panel 2, Pero No He Podido Pasarlo A Un Tercer Panel Y Asi Sucesivamente, Ya Que Al Precionar El Boton Siguiente Se Va Del Primero Al Ultimo Y Necesito Que Sea De Forma Secuencial.
Alguien Puede Decirme Como Puedo Hacerlo Con Panela U Otro Componente... Gracias |
Yo cambiaría los paneles por un PageControl, así podría añadir cuantos TabSheet necesite para las preguntas.
Luego en los botones Anterior y Siguiente solo tendría que usar esto:
Saludos! |
Añado... hay que colocar un manejo de excepción cuándo estes en el primer Tab e intentes ir hacia atras o en el último e intentes ir hacia adelante.
Saludos! |
Hola.
Los desbordes de índice también se pueden evitar de este modo:
Saludos. :) |
GRACIAS AMIGOS
PARA EVITAR LOS DESBORDES LO HICE ASI: procedure TForm1.BSIGUIENTEClick(Sender: TObject); begin PageControl1.Pages[PageControl1.TabIndex + 1].Show; if pagecontrol1.TabIndex >= 1 then button2.Enabled:=true; if pagecontrol1.TabIndex >= 2 then button1.Enabled:=false else button1.Enabled:=true; end; procedure TForm1.BANTERIORClick(Sender: TObject); begin PageControl1.Pages[PageControl1.TabIndex - 1].Show; if pagecontrol1.TabIndex >= 1 then button2.Enabled:=true; if pagecontrol1.TabIndex = 0 then button2.Enabled:=false else button1.Enabled:=true; end; LO PROBE CON 3 TABSHEET, DE ESA FORMA PUEDO CONTROLAR QUE CUANDO LLEGUE AL PRIMER O ULTIMO TAP LOS BOTONES SE INACTIVEN, NO SE SI ES LA MEJOR FORMA PERO FUNCIONA GRACIAS POR SU AYUDA, SON UNOS GENIOS... |
ok una cosilla más, si quieres q se vea como un panel sencillo y ordinario :D, entonces revisa el componente TNotebook, puedes cambiar de hoja o página con esto:
saludos! otra cosilla, para poner código de delphi aqui te recomiendo q uses el comando "[ Delphi]" <- el q inicia la instrucción, ny "[ /Delphi] <- el q cierra. ej : "[ DELPHI] MI CODIGO [/delphi]" saludos , sin las comillas ni los espacios eh?! |
Optimizado, con excepciones y habilitando o deshabilitando el boton ;)
Saludos! |
La franja horaria es GMT +2. Ahora son las 19:58:39. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi