//--------------------------------------------------------------------------- { //修改此单字符串窗口组件性质,可自由缩放大小 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即可被拖曳 void __fastcall tform1::edit1mousedown(tobject *sender, { if(edit1->cursor == crarrow ) { //释放原有鼠标捕捉状态, //并同时送出鼠标单击位置等同于窗口标题栏可拖曳窗口的属性 ::releasecapture(); sndmsg(edit1->handle, wm_nclbuttondown, htcaption, 0); } } //--------------------------------------------------------------------------- void __fastcall tform1::edit1mousemove(tobject *sender, tshiftstate shift, { //鼠标在edit1上移动时,仍保持箭头图标 edit1->cursor = crarrow; } //--------------------------------------------------------------------------- |