麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 編程 > Delphi > 正文

模擬delphi編輯窗體操作控件。。。

2019-11-18 18:01:22
字體:
供稿:網(wǎng)友
 

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, jpeg;
const LMouseDown=False;
type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Panel2: TPanel;
    Panel1: TPanel;
    Panel3: TPanel;
    Panel4: TPanel;
    Panel5: TPanel;
    Panel6: TPanel;
    Panel7: TPanel;
    Panel8: TPanel;
    Panel11: TPanel;
    Panel22: TPanel;
    Panel33: TPanel;
    Panel44: TPanel;
    Panel55: TPanel;
    Panel66: TPanel;
    Panel77: TPanel;
    Panel88: TPanel;
    Button1: TButton;
    PRocedure Edit1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Edit1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Edit1MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Button1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Button1MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  s,a:boolean;
implementation

{$R *.dfm}

 procedure ManipulateControl(Control: TControl; Shift: TShiftState; X, Y, Precision: integer);
var SC_MANIPULATE: Word;
begin
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  //光標(biāo)在控件的最左側(cè)**********************************************************
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       if (X<=Precision) and (Y>Precision) and (Y<Control.Height-Precision)
  then begin
         SC_MANIPULATE  := $F001;
         Control.Cursor := crSizeWE;
       end
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  //光標(biāo)在控件的最右側(cè)**********************************************************
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  else if (X>=Control.Width-Precision) and (Y>Precision) and (Y<Control.Height-Precision)
  then begin
         SC_MANIPULATE  := $F002;
         Control.Cursor := crSizeWE;
       end
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  //光標(biāo)在控件的最上側(cè)**********************************************************
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  else if (X>Precision) and (X<Control.Width-Precision) and (Y<=Precision)
  then begin
         SC_MANIPULATE  := $F003;
         Control.Cursor := crSizeNS;
       end
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  //光標(biāo)在控件的左上角**********************************************************
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  else if (X<=Precision) and (Y<=Precision)
  then begin
         SC_MANIPULATE  := $F004;
         Control.Cursor := crSizeNWSE;
       end
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  //光標(biāo)在控件的右上角**********************************************************
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  else if (X>=Control.Width-Precision) and (Y<=Precision)
  then begin
         SC_MANIPULATE  := $F005;
         Control.Cursor := crSizeNESW    ;
       end
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  //光標(biāo)在控件的最下側(cè)**********************************************************
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  else if (X>Precision) and (X<Control.Width-Precision) and (Y>=Control.Height-Precision)
  then begin
         SC_MANIPULATE  := $F006;
         Control.Cursor := crSizeNS;
       end
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  //光標(biāo)在控件的左下角**********************************************************
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  else if (X<=Precision) and (Y>=Control.Height-Precision)
  then begin
         SC_MANIPULATE  := $F007;
         Control.Cursor := crSizeNESW;
       end
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  //光標(biāo)在控件的右下角**********************************************************
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  else if (X>=Control.Width-Precision) and (Y>=Control.Height-Precision)
  then begin
         SC_MANIPULATE  := $F008;
         Control.Cursor := crSizeNWSE;
       end
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  //光標(biāo)在控件的客戶區(qū)(移動整個控件)******************************************
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  else if (X>5) and (Y>5) and (X<Control.Width-5) and (Y<Control.Height-5)
  then begin
         SC_MANIPULATE  := $F009;
         Control.Cursor := crSizeAll;
       end
  else begin
         SC_MANIPULATE := $F000;
         Control.Cursor := crDefault;
       end;
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  if Shift=[ssLeft] then
  begin
    ReleaseCapture;
    Control.Perform(WM_SYSCOMMAND, SC_MANIPULATE, 0);
  end;
  end;
procedure TForm1.Edit1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  ManipulateControl((Sender as TControl), Shift, X, Y, 9);
  edit1.Hint:='Edit1:TEdit'+chr(13)+'Origin:'+IntToStr(edit1.Top)+','
  +IntToStr(edit1.Left)+';'+'Size:'+IntToStr(edit1.Width)+IntToStr(edit1.Height)+chr(13)+'Tab Stop:Ture;Order:0';
        if s=true then
        begin
        a:=false;
        panel1.Visible:=true;      panel2.Visible:=true;     panel3.Visible:=true;
        panel4.Visible:=true;      panel5.Visible:=true;
        panel6.Visible:=true;      panel7.Visible:=true;     panel8.Visible:=true;
        panel1.top:=edit1.Top-6;
        panel1.Left:=edit1.Left-6;
        panel2.Top:=edit1.Top+(edit1.Height div 2)-3;
        panel2.Left:=edit1.Left-6;
        panel3.Top:=edit1.Top+edit1.Height;
        panel3.Left:=edit1.Left-6;
        panel4.Top:=edit1.top-6;
        panel4.Left:=edit1.Left+(edit1.Width div 2);
        panel5.Top:=edit1.Top+edit1.Height;
        panel5.Left:=edit1.Left+(edit1.Width div 2);
        panel6.Top:=edit1.Top-6;
        panel6.Left:=edit1.Left+edit1.Width;
        panel7.Top:=edit1.Top+(edit1.Height div 2)-3;
        panel7.Left:=edit1.Left+edit1.Width;
        panel8.top:=edit1.Top+edit1.Height;
        panel8.Left:=edit1.Left+edit1.Width;
        end;
end;

procedure TForm1.Edit1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin

        panel11.Visible:=false;      panel22.Visible:=false;     panel33.Visible:=false;
        panel44.Visible:=false;      panel55.Visible:=false;
        panel66.Visible:=false;      panel77.Visible:=false;     panel88.Visible:=false;

  s:=true;
  a:=false;
        panel1.Visible:=true;      panel2.Visible:=true;     panel3.Visible:=true;
        panel4.Visible:=true;      panel5.Visible:=true;
        panel6.Visible:=true;      panel7.Visible:=true;     panel8.Visible:=true;
        panel1.top:=edit1.Top-6;
        panel1.Left:=edit1.Left-6;
        panel2.Top:=edit1.Top+(edit1.Height div 2)-3;
        panel2.Left:=edit1.Left-6;
        panel3.Top:=edit1.Top+edit1.Height;
        panel3.Left:=edit1.Left-6;
        panel4.Top:=edit1.top-6;
        panel4.Left:=edit1.Left+(edit1.Width div 2);
        panel5.Top:=edit1.Top+edit1.Height;
        panel5.Left:=edit1.Left+(edit1.Width div 2);
        panel6.Top:=edit1.Top-6;
        panel6.Left:=edit1.Left+edit1.Width;
        panel7.Top:=edit1.Top+(edit1.Height div 2)-3;
        panel7.Left:=edit1.Left+edit1.Width;
        panel8.top:=edit1.Top+edit1.Height;
        panel8.Left:=edit1.Left+edit1.Width;
end;

procedure TForm1.Edit1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
        if s=true then
        begin
        a:=false;
        s:=false;
        panel1.Visible:=true;      panel2.Visible:=true;     panel3.Visible:=true;
        panel4.Visible:=true;      panel5.Visible:=true;
        panel6.Visible:=true;      panel7.Visible:=true;     panel8.Visible:=true;
        panel1.top:=edit1.Top-6;
        panel1.Left:=edit1.Left-6;
        panel2.Top:=edit1.Top+(edit1.Height div 2)-3;
        panel2.Left:=edit1.Left-6;
        panel3.Top:=edit1.Top+edit1.Height;
        panel3.Left:=edit1.Left-6;
        panel4.Top:=edit1.top-6;
        panel4.Left:=edit1.Left+(edit1.Width div 2);
        panel5.Top:=edit1.Top+edit1.Height;
        panel5.Left:=edit1.Left+(edit1.Width div 2);
        panel6.Top:=edit1.Top-6;
        panel6.Left:=edit1.Left+edit1.Width;
        panel7.Top:=edit1.Top+(edit1.Height div 2)-3;
        panel7.Left:=edit1.Left+edit1.Width;
        panel8.top:=edit1.Top+edit1.Height;
        panel8.Left:=edit1.Left+edit1.Width;
        end;
end;
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
a:=false;
s:=false;
        panel1.Visible:=false;      panel2.Visible:=false;     panel3.Visible:=false;
        panel4.Visible:=false;      panel5.Visible:=false;
        panel6.Visible:=false;      panel7.Visible:=false;     panel8.Visible:=false;
       //**********
        panel11.Visible:=false;      panel22.Visible:=false;     panel33.Visible:=false;
        panel44.Visible:=false;      panel55.Visible:=false;
        panel66.Visible:=false;      panel77.Visible:=false;     panel88.Visible:=false;

end;
procedure TForm1.Button1MouseUp(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);
begin if a=true then
        begin
        a:=false;
        s:=false;
        panel1.Visible:=false;      panel2.Visible:=false;     panel3.Visible:=false;
        panel4.Visible:=false;      panel5.Visible:=false;
        panel6.Visible:=false;      panel7.Visible:=false;     panel8.Visible:=false;

        panel11.Visible:=true;
        panel22.Visible:=true;
        panel33.Visible:=true;
        panel44.Visible:=true;
        panel55.Visible:=true;
        panel66.Visible:=true;
        panel77.Visible:=true;
        panel88.Visible:=true;
        panel11.top:=Button1.Top-6;
        panel11.Left:=Button1.Left-6;
        panel22.Top:=Button1.Top+(Button1.Height div 2)-3;
        panel22.Left:=Button1.Left-6;
        panel33.Top:=Button1.Top+Button1.Height;
        panel33.Left:=Button1.Left-6;
        panel44.Top:=Button1.top-6;
        panel44.Left:=Button1.Left+(Button1.Width div 2);
        panel55.Top:=Button1.Top+Button1.Height;
        panel55.Left:=Button1.Left+(Button1.Width div 2);
        panel66.Top:=Button1.Top-6;
        panel66.Left:=Button1.Left+Button1.Width;
        panel77.Top:=Button1.Top+(Button1.Height div 2)-3;
        panel77.Left:=Button1.Left+Button1.Width;
        panel88.top:=Button1.Top+Button1.Height;
        panel88.Left:=Button1.Left+Button1.Width;
        end;
end;
 procedure TForm1.Button1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
    a:=true;
    s:=false;
        panel1.Visible:=false;      panel2.Visible:=false;     panel3.Visible:=false;
        panel4.Visible:=false;      panel5.Visible:=false;
        panel6.Visible:=false;      panel7.Visible:=false;     panel8.Visible:=false;

        panel11.Visible:=true;      panel22.Visible:=true;     panel33.Visible:=true;
        panel44.Visible:=true;      panel55.Visible:=true;
        panel66.Visible:=true;      panel77.Visible:=true;     panel88.Visible:=true;
        panel11.top:=Button1.Top-6;
        panel11.Left:=Button1.Left-6;
        panel22.Top:=Button1.Top+(Button1.Height div 2)-3;
        panel22.Left:=Button1.Left-6;
        panel33.Top:=Button1.Top+Button1.Height;
        panel33.Left:=Button1.Left-6;
        panel44.Top:=Button1.top-6;
        panel44.Left:=Button1.Left+(Button1.Width div 2);
        panel55.Top:=Button1.Top+Button1.Height;
        panel55.Left:=Button1.Left+(Button1.Width div 2);
        panel66.Top:=Button1.Top-6;
        panel66.Left:=Button1.Left+Button1.Width;
        panel77.Top:=Button1.Top+(Button1.Height div 2)-3;
        panel77.Left:=Button1.Left+Button1.Width;
        panel88.top:=Button1.Top+Button1.Height;
        panel88.Left:=Button1.Left+Button1.Width;
end;

 procedure TForm1.Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  ManipulateControl((Sender as TControl), Shift, X, Y, 9);
  edit1.Hint:='Button1:TButton'+chr(13)+'Origin:'+IntToStr(Button1.Top)+','
  +IntToStr(Button1.Left)+';'+'Size:'+IntToStr(Button1.Width)+IntToStr(Button1.Height)+chr(13)+'Tab Stop:Ture;Order:0';
      
     
       if a=true then
        begin
        s:=false;
        panel1.Visible:=false;      panel2.Visible:=false;     panel3.Visible:=false;
        panel4.Visible:=false;      panel5.Visible:=false;
        panel6.Visible:=false;      panel7.Visible:=false;     panel8.Visible:=false;

        panel11.Visible:=true;      panel22.Visible:=true;     panel33.Visible:=true;
        panel44.Visible:=true;      panel55.Visible:=true;
        panel66.Visible:=true;      panel77.Visible:=true;     panel88.Visible:=true;
        panel11.top:=Button1.Top-6;
        panel11.Left:=Button1.Left-6;
        panel22.Top:=Button1.Top+(Button1.Height div 2)-3;
        panel22.Left:=Button1.Left-6;
        panel33.Top:=Button1.Top+Button1.Height;
        panel33.Left:=Button1.Left-6;
        panel44.Top:=Button1.top-6;
        panel44.Left:=Button1.Left+(Button1.Width div 2);
        panel55.Top:=Button1.Top+Button1.Height;
        panel55.Left:=Button1.Left+(Button1.Width div 2);
        panel66.Top:=Button1.Top-6;
        panel66.Left:=Button1.Left+Button1.Width;
        panel77.Top:=Button1.Top+(Button1.Height div 2)-3;
        panel77.Left:=Button1.Left+Button1.Width;
        panel88.top:=Button1.Top+Button1.Height;
        panel88.Left:=Button1.Left+Button1.Width;
        end;
end;

end.


上一篇:Oracle中通過存儲過程中返回數(shù)據(jù)集及在Delphi中使用

下一篇:PowerBuilder調(diào)用Delphi寫的Dll時發(fā)生的奇怪問題

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
學(xué)習(xí)交流
熱門圖片

新聞熱點(diǎn)

疑難解答

圖片精選

網(wǎng)友關(guān)注

主站蜘蛛池模板: 日韩美香港a一级毛片 | 一级做a爱片性色毛片高清 日本一区二区在线看 | 国产精品av久久久久久久久久 | 空姐毛片 | 91久久精品一区二区 | 久久久久久久91 | v11av在线播放| 国产69久久久 | 午夜视频久久久 | 久久激情国产 | 久久久久北条麻妃免费看 | 久久久久久久久久久av | 色视频在线播放 | 久久久精品视 | 日韩一级免费毛片 | 国产九九九九 | av成人在线电影 | 欧美a黄| 久久久久中精品中文字幕19 | 久久精品亚洲成在人线av网址 | 婷婷久久青草热一区二区 | 97porn| 香蕉秀| 久久91久久| 中文字幕在线永久 | av在线免费观看网 | 国产精品久久久久久久久久大牛 | av成人免费观看 | 狠狠干天天操 | 一级在线免费观看视频 | 精品一区二区三区免费毛片爱 | 中文字幕亚洲视频 | 成人精品久久久 | 日本在线播放一区二区 | 日韩黄色免费电影 | 久久草在线视频免费 | 久久成年网 | 日本一道aⅴ不卡免费播放 久久久久久久高清 | 国产一区二区欧美精品 | 国产亚洲美女精品久久久2020 | 精品国产一区二区三区天美传媒 |