我想做一个可以手动调整控件大小的程序,如让其变长或变宽,主要是针对Shape操作。
请高手帮忙
请高手帮忙
解决方案 »
- 写一个可调整(设置)字符间距的Edit控件
- 如何自动输入网页中的编辑框
- QuickReport调用print方法后,出现保存对话框,要保存后打印机才开始打印,怎么办?
- 急问:DBGridEh控件,使用打印预览出现的问题.
- 三层结构的一些提问,答者有分.
- 我是新手。
- 千刀万剐,小偷黑心贼;痛哭流涕,我的文曲星!!!为它哀吊3秒,呜呼哀哉...谨防小偷!!!
- 发送到桌面快捷方式后,程序不能调帮助文件了,为什么?
- 问一个在代理服务器下远程连接到SQL服务器的问题?
- 如何向打开的指定Dos窗口发送Ctrl+C信息?
- 怎样使messagedlg出现的标题和内容以及按钮上的文字都是自己定义的中文?
- 举重那女孩真强!!
Y: Integer);
begin
if (x>=0)and(x<=3) then
begin
if (y>=0)and(y<=3) then shape1.Cursor:=crSizeNWSE;
if (y>3)and(y<shape1.Height-3) then shape1.Cursor:=crSizeWE;
if (y>=shape1.Height-3)and(y<=shape1.Height) then shape1.Cursor:=crSizeNESW;
end
else if (x>3)and(x<shape1.Width-3) then
begin
if (y>=0)and(y<=3) then shape1.Cursor:=crSizeNS;
if (y>3)and(y<shape1.Height-3) then shape1.Cursor:=crArrow;
if (y>=shape1.Height-3)and(y<=shape1.Width) then shape1.Cursor:=crSizeNS;
end
else if (x>=shape1.Width-3)and(x<=shape1.Width) then
begin
if (y>=0)and(y<=3) then shape1.Cursor:=crSizeNESW;
if (y>3)and(y<shape1.Height-3) then shape1.Cursor:=crSizeWE;
if (y>=shape1.Height-3)and(y<=shape1.Width) then shape1.Cursor:=crSizeNWSE;
end;
end;procedure TForm1.shape1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
if (x>=0)and(x<=3) then
begin
if (y>=0)and(y<=3) then shape1.Perform(WM_SysCommand,$F004,0);
if (y>3)and(y<shape1.Height-3) then shape1.Perform(WM_SysCommand,$F001,0);
if (y>=shape1.Height-3)and(y<=shape1.Height) then shape1.Perform(WM_SysCommand,$F007,0);
end
else if (x>3)and(x<shape1.Width-3) then
begin
if (y>=0)and(y<=3) then shape1.Perform(WM_SysCommand,$F003,0);
if (y>3)and(y<shape1.Height-3) then shape1.Perform(WM_SysCommand,$F012,0);
if (y>=shape1.Height-3)and(y<=shape1.Width) then shape1.Perform(WM_SysCommand,$F006,0);
end
else if (x>=shape1.Width-3)and(x<=shape1.Width) then
begin
if (y>=0)and(y<=3) then shape1.Perform(WM_SysCommand,$F005,0);
if (y>3)and(y<shape1.Height-3) then shape1.Perform(WM_SysCommand,$F002,0);
if (y>=shape1.Height-3)and(y<=shape1.Width) then shape1.Perform(WM_SysCommand,$F008,0);
end;
end;
把shape1 换成 Panel1 就能达到效果!
为什么??
请多指点!
肯定是 shape1MouseDown 事件对shape1 不起作用,对 Panel1 起作用.