专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »C 教程 » jquery拖拽:创建一个可调整大小和拖拽的Edit »正文

jquery拖拽:创建一个可调整大小和拖拽的Edit

来源: 发布时间:星期四, 2008年9月25日 浏览:180次 评论:0
创建一个可调整大小和拖拽的edit
//---------------------------------------------------------------------------
__fastcall tform1::tform1(tcomponent* owner)
: tform(owner)
{
//修改此单字符串窗口组件性质,可自由缩放大小
dword dwstyle = ::getwindowlong(edit1->handle, gwl_style);
::setwindowlong(edit1->handle, gwl_style, dwstyle | ws_sizebox);
//修正此单字符串窗口组件在form1上的实际尺寸与范围
//以便user直接调整单字符串窗口组件边沿
::movewindow(edit1->handle, edit1->left, edit1->top,
edit1->width, edit1->height + 1, true);
}
//---------------------------------------------------------------------------
//当鼠标保持箭头图标时,edit1即可被拖曳
void __fastcall tform1::edit1mousedown(tobject *sender,
tmousebutton button, tshiftstate shift, int x, int y)
{
if(edit1->cursor == crarrow )
{
//释放原有鼠标捕捉状态,
//并同时送出鼠标单击位置等同于窗口标题栏可拖曳窗口的属性
::releasecapture();
sndmsg(edit1->handle, wm_nclbuttondown, htcaption, 0);
}
}
//---------------------------------------------------------------------------
void __fastcall tform1::edit1mousemove(tobject *sender, tshiftstate shift,
int x, int y)
{
//鼠标在edit1上移动时,仍保持箭头图标
edit1->cursor = crarrow;
}
//---------------------------------------------------------------------------
0

相关文章

读者评论

发表评论

  • 昵称:
  • 内容: