Ver Mensaje Individual
  #5  
Antiguo 09-08-2017
Avatar de TOPX
TOPX TOPX is offline
Miembro
 
Registrado: may 2008
Ubicación: Bogotá
Posts: 527
Reputación: 16
TOPX Va camino a la fama
Cita:
Empezado por ecfisa Ver Mensaje
Código Delphi [-]
    if TButton(Sender).Name = 'Button1' then   // ¿ Es Button1 ?
      ListBox1.Items.AddStrings(lista1);

    if TButton(Sender).Name = 'Button2' then  // ¿ Es Button2 ?
      ListBox2.Items.AddStrings(lista2);
Personalmente, me gustaría más de la siguiente manera:
Código Delphi [-]
    if Sender = Button1 then   // ¿ Es Button1 ?
      ListBox1.Items.AddStrings(lista1)
    else
    if Sender = Button2 then  // ¿ Es Button2 ?
      ListBox2.Items.AddStrings(lista2);
Pero creo que ya son reparos de la vejez.
-
__________________
"constructive mind, destructive thoughts"
Responder Con Cita