用消息截取吗?
怎么实现?

解决方案 »

  1.   

    button.OnClick := nil不触发Click事件,但会凹下去
    楼上的正解,呵呵,禁止了就不会了哦
      

  2.   

    button.enable=false;
    如果觉得字体颜色变成灰色不好看就,用下面的办法。先放一个panle。把他的enable:=false;然后在panle上面放button就可以了
      

  3.   

    晕死button.enable:=false这谁不会??
    我是要让按钮不凹下去,不去触发click事件
    要把click事件消息截取,谁会?救我
      

  4.   

    干吗用button啊,用其他的不一样啊。
      

  5.   

    可以用speedbutton阿,干吗要在一棵树上吊死啊
      

  6.   

    从Button派生一个自己的Button撒,想要他怎么样就怎么样...呵呵,要学会写组件哦
      

  7.   

    给button写MouseDown事件procedure TForm1.Button1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    begin
    button1.OnClick:=nil;
    SendMessage(button1.handle,WM_LBUTTONup,-1,1);
    end;
      

  8.   

    你也可以写一个自己的button类(继承tbutton),对wm_lbuttondown不做任何处理(但一定要写一个空方法)大概如下:
    TYourButton=class(tbutton)
      procedure onYourMouseDownEvent(var msg:twmlbuttondown);message wm_lbuttondown;
    end;procedure onYourMouseDownEvent(var msg:twmlbuttondown);
    begin
      //不做任何事情
    end;
      

  9.   

    procedure TYourButton.onYourMouseDownEvent(var msg:twmlbuttondown);message wm_lbuttondown;
    begin
      //不做任何事情
    end;
      

  10.   

    SendMessage(button1.handle,WM_LBUTTONup,-1,1)的几个参数代表什么意思?
      

  11.   

    窗口子类化即可OldProc := GetWindowLong(Button1.Handle, GWL_WNDPROC);//先保存窗口Button1的消息处理函数SetWindowLong(Button1.Handle, GWL_WNDPROC, Longint(@MyProc));//当需要时改变消息处理函数SetWindowLong(Button1.Handle, GWL_WNDPROC, oldProc);//恢复消息处理函数,注销窗体前要强制恢复,否则释放Button1会出错而自定意的窗体消息处理函数什么也不用做即可
    procedure MyProc(var Message: TMessage);
    beginend;
      

  12.   

    在Windows下搞开发,最好先建立起Windows程序的基本概念
      

  13.   

    //而自定意的窗体消息处理函数什么也不用做即可
      procedure MyProc(var Mes: TMessage);
      begin
        //if message.Msg=wm_lbuttondown then exit;
        button1.DefaultHandler(mes);
        //button1.OnClick:=nil;
      end;什么也不做可不行,那样的话这个按钮根本就不会重画
      procedure MyProc(var Mes: TMessage);
      begin
        //仅仅对wm_lbuttondown不响应
        if message.Msg=wm_lbuttondown then exit;    
        button1.DefaultHandler(mes);
      end;
      

  14.   

    用Panel代替吧,完全满足你的各种要求,ehom(?!) 的方法太麻烦,用Delphi编程还是用Delphi的思考方式比较好,如果为了解决这种问题都要去使用SDK的方式的话,那不如不用Delphi算了!抛弃Delphi的优势而走弯路,不是明智之举