Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,326

    [delphi] ottenere nome frame che richiama hotkey

    Ciao,

    ho inserito nella mia applicazione degli hotkey.

    questi possono essere richiamati da qualsiasi frame della stessa applicazione... e finqui tutto bene.

    ho solo un problema:

    come faccio a risalire al nome del frame attivo quando premo un tasto hotkey?

    grazie

  2. #2
    Moderatore di Programmazione L'avatar di alka
    Registrato dal
    Oct 2001
    residenza
    Reggio Emilia
    Messaggi
    24,472
    Ma la hotkey come viene intercettata? Si tratta di uno Shortcut assegnazione ad un'azione? Dove è definita l'azione?
    MARCO BREVEGLIERI
    Software and Web Developer, Teacher and Consultant

    Home | Blog | Delphi Podcast | Twitch | Altro...

  3. #3
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,326
    Ciao Marco e grazie....

    dal main principale creo il mio frame.....

    ricordi quel sistema che vedemmo....

    codice:
    procedure TFrmMain.ShowPage(PageClass: TMyPageFrameClass;RefreshPage:Boolean);
    begin
      if PageClass = nil then Exit;
      if FCurrentPage <> nil then
        if (FCurrentPage.ClassType = PageClass) and (not RefreshPage) then Exit;
      if FCurrentPage <> nil then
      begin
        screen.Cursor := crHourGlass;
        FCurrentPage.ClosePage;
        FCurrentPage.Free;
        FCurrentPage := nil;
        screen.Cursor := crDefault;
      end;
      FCurrentPage := PageClass.Create(Self);
      try
        if FCurrentPage <> nil then
        begin
          screen.Cursor := crHourGlass;
          FCurrentPage.Parent := FrmMain ;
          FCurrentPage.InitializePage;
          screen.Cursor := crDefault;
        end;
      except
        screen.Cursor := crHourGlass;
        WM_Id:='';
        FCurrentPage.ClosePage;
        FCurrentPage.Free;
        FCurrentPage := nil;
        screen.Cursor := crDefault;
      end;
    end;
    adesso nel frame creato ho inserito il componente TApplicationEvents e sull'evento onshortcut:

    codice:
    procedure TFrameMovimenti.ApplicationEvents1ShortCut(var Msg: TWMKey;
      var Handled: Boolean);
    begin
      inherited;
    
       if DM.IBDataSetMovimentiID.Text ='' then Abort();
    
       if (Msg.CharCode = VK_F10) then
         begin
          if BtnPrintRiassunto.Visible then BtnPrintRiassunto.Click;
          Abort;
         end;
    end;
    il problema e' che dal mio frame puo essere effettuato lo showmodal di un ulteriore form... ed io vorrei che il tasto hotkay ( f10 ) non avesse effetto.

    grazie

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.