Ver Mensaje Individual
  #4  
Antiguo 08-02-2017
Avatar de escafandra
[escafandra] escafandra is offline
Miembro Premium
 
Registrado: nov 2007
Posts: 2.211
Reputación: 22
escafandra Tiene un aura espectacularescafandra Tiene un aura espectacular
Simplificando, no es necesario realizar tanto cast y se puede escribir así:

Código PHP:
void __fastcall TForm1::tres1Click(TObject *Sender)
{
  
TMenuItem *I = static_cast<TMenuItem*>(Sender);
  while(
I->Parent->Parent)
    
I = I->Parent;
  
Caption = I->Caption;
} 

Saludos.
Responder Con Cita