关注次题,本人也遇到这个问题了,还有就是默认为回车怎么办?
用BUTTON,不用BITBUTTON

解决方案 »

  1.   

    用ActionList控件与按钮关联起来,也可在在From的OnShortCut事件拦截
      

  2.   

    用ActionList可以解决你的一切问题。
      

  3.   

    1.首先,设置你的FORM的KEYPREVIEW为 true.
    2.接着,设置FORM的KEYDOWN事件
            IF key='key_a' and ssctrl in ssshift then
                               button1click(nil);
    3.设置BUTTON1CLICK,任你处理。
      

  4.   

    用ActionList可以解决你的一切问题!
    你在里面NEW一个ACTION设置它的SHORTCUT=CTRL+A,
    然后在BUTTON的第一个属性即ACTION里选择你刚NEW出来的ACTION就可以了
    还有“默认为回车”你只能设置BUTTON的Default := True就可以了
      

  5.   

    窗体上放一个Button1,ActionList1
    双击ActionList1,在Action栏里右键,new Action,
    在新添的Action1的Action1Execute事件里写你的代码,
    Button1的Action属性选择Action1.
      

  6.   

    不好意思各位,用ActionList怎么用,我是菜鸟,(它是Delphi是控件吗?)
    在Delphi6中的哪 里?
      

  7.   

    在standard面板的最后一个,也就是第一个面板的最后一个控件
      

  8.   

    //pas
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure FormKeyDown(Sender: TObject; var Key: Word;
          Shift: TShiftState);
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
     case Key of
       $41: if [ssCtrl] = Shift then Button1.Click;
     end;
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
      ShowMessage('ok');
    end;end.//dfm
    object Form1: TForm1
      Left = 192
      Top = 107
      Width = 544
      Height = 375
      Caption = 'Form1'
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      KeyPreview = True
      OldCreateOrder = False
      OnKeyDown = FormKeyDown
      PixelsPerInch = 96
      TextHeight = 13
      object Button1: TButton
        Left = 48
        Top = 304
        Width = 75
        Height = 25
        Caption = 'Button1'
        TabOrder = 0
        OnClick = Button1Click
      end
    end