Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disbale next page (Ctrl + Tab) 1

Status
Not open for further replies.

EricDraven

Programmer
Jan 17, 2002
2,999
GB
I have an MDI application with a number of fixed size forms which are selected by clicking the corresponding button on the main form. The forms are only displayed providing that the user currently logged in has an access clearence sufficient for that page. Unfortunatley, by pressing Ctrl and Tab, the MDI app skips to the next page bypassing the checks I have put in place.

Does anybody know if I can disable the Ctrl + Tab function in my program??? Arte Et Labore
 
Hey Eric. Here's a sample code. It's bit ugly, but it works, kind of "fast" solution, just place it to your main MDI form...:
Code:
procedure TMainForm.FormCreate(Sender: TObject);
begin
 ...
  Application.OnMessage := OnMsg;
 ...
end;

procedure TMainForm.OnMsg(var Msg: TMsg; var Handled: Boolean);
begin
  if (Msg.Message = WM_KEYDOWN)then
  begin
    if (Msg.wParam = VK_TAB)then
    begin
      if (ssCtrl in KeyDataToShiftState(Msg.lParam)) then
       Handled := True;
    end;
  end;
end;

--- markus
 
Many thanks to you McMerfy! You have not only solved my problem I think its actually the first time Ive had a query on here 100% resolved and its most definatly the quickest response Ive received.

Cheers! Have a well deserved star! Arte Et Labore
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top