edit1.Text:=''就可清除edit内容
让窗口不能移动得相应WM_WINDOWPOSCHANGING消息。

解决方案 »

  1.   

    把EDIT的ReadOonly设为true就可以了
      

  2.   

    eg:
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type
      TForm1 = class(TForm)
      private
        { Private declarations }
      public
    procedure WMWindowsPos(var Msg:TWMWindowPosMsg);message WM_WINDOWPOSCHANGING; 
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}procedure TForm1.WMWindowsPos(var Msg: TWMWindowPosMsg);
    begin
    with msg do
    Begin
    WindowPos.x:=Left;
    WindowPos.y:=Top;
    WindowPos.cx:=Width;
    WindowPos.cy:=Height;
    end;
    end;end.
    //这样窗体就没法移动啦,另外可以重载WM_NCHITTEST,返回客户区域也行。
      

  3.   

    procedure WindowNoMove(Var ValMsg: TMessage); Message WM_NCHITTEST;procedure TMainFrm.WindowNoMove(var ValMsg: TMessage);
    begin
      inherited;
      if ValMsg.Result = HTCAPTION then
      begin
        ValMsg.Result := HTCLIENT;
      end;
    end;