Einzelnen Beitrag anzeigen

Benutzerbild von samson
samson

Registriert seit: 26. Aug 2003
Ort: Hövelhof Riege
105 Beiträge
 
Delphi 2007 Professional
 
#1

Auf der Suche nach: FindNextControl

  Alt 28. Okt 2003, 13:41
Hallo,

Ich habe ein PageControl, welches mehrere TabSheets enthält. Damit ich meine Software per Keyboard bedienen kann, habe ich eine Funktion geschrieben, welche mit [STRG]+[1..9] das entsprechende Tab auswählt.

Die Funktion:

Delphi-Quellcode:
procedure HSMChgTabSheet(pcPageControl:TPageControl; const Key:word);
begin
  case Key of
    VK_1 : if 1 <= pcPageControl.PageCount then pcPageControl.ActivePageIndex := 0;
    VK_2 : if 2 <= pcPageControl.PageCount then pcPageControl.ActivePageIndex := 1;
    VK_3 : if 3 <= pcPageControl.PageCount then pcPageControl.ActivePageIndex := 2;
    VK_4 : if 4 <= pcPageControl.PageCount then pcPageControl.ActivePageIndex := 3;
    VK_5 : if 5 <= pcPageControl.PageCount then pcPageControl.ActivePageIndex := 4;
    VK_6 : if 6 <= pcPageControl.PageCount then pcPageControl.ActivePageIndex := 5;
    VK_7 : if 7 <= pcPageControl.PageCount then pcPageControl.ActivePageIndex := 6;
    VK_8 : if 8 <= pcPageControl.PageCount then pcPageControl.ActivePageIndex := 7;
    VK_9 : if 9 <= pcPageControl.PageCount then pcPageControl.ActivePageIndex := 8;
  end;
end;
Diese Funktion zeigt die TabSheets auch wunderbar an, nur das ich noch so keine richtige Idee habe, wie ich das erste Element selektieren kann.

Jetzt bin ich in der Hilfe auf die Funktion: FindNexControl(..) aufmerksam geworden.

Ein TabSheet bzw. PageControl ist doch von TWinControl abgeleitet. Ich verstehe nicht, warum ich die Methode nicht habe, bzw. nicht aufrufen kann.

Hat vielleicht jemand einen Tip für mich???


Grusss


Samson
Frank Gellermann
Wer Informationen hat, hat Macht. Wer Macht hat, hat Informationen!!!
  Mit Zitat antworten Zitat