public class resize
private void mousemove(object sender,mouseeventargs e)
int sizeagex = (cursor.position.x-this.frm.desktoplocation.x-this.wtap-this.ctrl.location.x);
int sizeagey = (cursor.position.y-this.frm.desktoplocation.y-this.htap-this.ctrl.location.y);
if (sizeagex < 2)
sizeagex = 1;
if (sizeagey < 2)
sizeagey = 1;
ctrlwidth = sizeagex;
ctrlheight = sizeagey;
if (ctrllastwidth == 0)
ctrllastwidth = ctrlwidth;
if (ctrllastheight==0)
ctrllastheight = ctrlheight;
if (ctrlisresizing)
ctrlisresizing = true;
controlpaint.drawreversibleframe(ctrlrectangle, color.empty, system.windows.forms.framestyle.dashed);
ctrllastwidth = ctrlwidth;
ctrllastheight = ctrlheight;
ctrlrectangle.location = new system.drawing.point(this.frm.desktoplocation.x+this.wtap+this.ctrl.left,this.frm.desktoplocation.y+this.htap+this.ctrl.top);
ctrlrectangle.size = new system.drawing.size(ctrlwidth,ctrlheight);
controlpaint.drawreversibleframe(ctrlrectangle, color.empty, system.windows.forms.framestyle.dashed);
}
}
private void mousedown(object sender,mouseeventargs e)
ctrlrectangle.location = new system.drawing.point(this.ctrlleft,this.ctrltop);
ctrlrectangle.size = new system.drawing.size(ctrlwidth,ctrlheight);
controlpaint.drawreversibleframe(ctrlrectangle, color.empty, system.windows.forms.framestyle.dashed);
}
private void mouseup(object sender,mouseeventargs e)
ctrlrectangle.location = new system.drawing.point(this.frm.desktoplocation.x+this.wtap+this.ctrl.left,this.frm.desktoplocation.y+this.htap+this.ctrl.top);
ctrlrectangle.size = new system.drawing.size(ctrlwidth,ctrlheight);
controlpaint.drawreversibleframe(ctrlrectangle, color.empty, system.windows.forms.framestyle.dashed);
this.ctrl.width = ctrlwidth;
this.ctrl.height = ctrlheight;
this.ctrl.refresh();
}
}
}
easyui datagrid動態改變大小
easyui layout中改變大小時對應datagrid大小自適應問題 由於center的layout中 datagrid被嵌入了乙個div,當左右拖動west的layout時,在layout center中的datagrid寬度不變 可能是datagrid外面被巢狀了乙個div吧,當沒有div時...
磁碟改變大小
1.首先檢視磁碟使用情況 root sambaserver df h 檔案系統 容量 已用 可用 已用 掛載點 136g 43g 87g 33 tmpfs 939m 0 939m 0 dev shm dev sda1 485m 32m 428m 7 boot 6.0g 160m 5.5g 3 hom...
MFC控制項大小隨窗體改變而改變大小
pragma once 程式說明 用於mfc程式控制元件隨著視窗大小改變而改變 標頭檔案 itemresize.h cpp檔案 itemresize.cpp 用法說明 1.在對話方塊標頭檔案中新增此類的物件 citemresize m itemsize 2.在視窗初始化函式 oninitdialog...