实现控件的移动、改变大小(DELPHI实现)[2]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 yandong_mars 的 blog

  begin
    if (y>=0)and(y<=3) then panel1.perform(wm_syscommand,$f003,0);
    if (y>3)and(y<panel1.height-3) then panel1.perform(wm_syscommand,$f012,0);
    if (y>=panel1.height-3)and(y<=panel1.width) then panel1.perform(wm_syscommand,$f006,0);
  end
  else if (x>=panel1.width-3)and(x<=panel1.width) then
  begin
    if (y>=0)and(y<=3) then panel1.perform(wm_syscommand,$f005,0);
    if (y>3)and(y<panel1.height-3) then panel1.perform(wm_syscommand,$f002,0);
    if (y>=panel1.height-3)and(y<=panel1.width) then panel1.perform(wm_syscommand,$f008,0);
  end;
end;

procedure tform1.panel1mousemove(sender: tobject; shift: tshiftstate; x,
  y: integer);
begin
  if (x>=0)and(x<=3) then
  begin
    if (y>=0)and(y<=3) then panel1.cursor:=crsizenwse;
    if (y>3)and(y<panel1.height-3) then panel1.cursor:=crsizewe;
    if (y>=panel1.height-3)and(y<=panel1.height) then panel1.cursor:=crsizenesw;
  end
  else if (x>3)and(x<panel1.width-3) then
  begin
    if (y>=0)and(y<=3) then panel1.cursor:=crsizens;
    if (y>3)and(y<panel1.height-3) then panel1.cursor:=crarrow;
    if (y>=panel1.height-3)and(y<=panel1.width) then panel1.cursor:=crsizens;
  end
  else if (x>=panel1.width-3)and(x<=panel1.width) then
  begin
    if (y>=0)and(y<=3) then panel1.cursor:=crsizenesw;
    if (y>3)and(y<panel1.height-3) then panel1.cursor:=crsizewe;
    if (y>=panel1.height-3)and(y<=panel1.width) then panel1.cursor:=crsizenwse;
  end;
end;

附录2.api sendmessage()介绍
sendmessage === user32.lib
lresult sendmessage(

    hwnd hwnd, // handle of destination window
    uint msg, // message to send
    wparam wparam, // first message parameter
    lparam lparam  // second message parameter

本文关键:移动 改变大小 Delphi
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top