例如:
int RowBedCount=7;// 每行床位数
int BedRowCount=4;// 显示床位行数
int BedWidth;int BedHeight;
public void BedPanelRefresh()
{
Bed bed=new Bed();
if(aryBed.Length == 0)return;
int iPanelScrollWidth = (aryBed.Length > (RowBedCount * BedRowCount))?20:0;//需要考虑到panel的scrollbar的宽度
BedHeight=(this.Height-BedRowCount+1) / BedRowCount;
BedWidth=(this.Width - iPanelScrollWidth - RowBedCount+1) / RowBedCount;
bed.Height = BedHeight;
bed.Width = BedWidth;
for( int i=0;i<aryBed.Length;i++)
{
aryBed[i].Height = BedHeight;
aryBed[i].Width = BedWidth;
if(i<RowBedCount)aryBed[i].Top = 0;
else aryBed[i].Top = aryBed[i-RowBedCount].Top + bed.Height+1; if((i%RowBedCount)==0)aryBed[i].Left = 0;
else aryBed[i].Left = aryBed[i-1].Left + bed.Width+1;
this.plBed.PerformLayout();
}
}
int RowBedCount=7;// 每行床位数
int BedRowCount=4;// 显示床位行数
int BedWidth;int BedHeight;
public void BedPanelRefresh()
{
Bed bed=new Bed();
if(aryBed.Length == 0)return;
int iPanelScrollWidth = (aryBed.Length > (RowBedCount * BedRowCount))?20:0;//需要考虑到panel的scrollbar的宽度
BedHeight=(this.Height-BedRowCount+1) / BedRowCount;
BedWidth=(this.Width - iPanelScrollWidth - RowBedCount+1) / RowBedCount;
bed.Height = BedHeight;
bed.Width = BedWidth;
for( int i=0;i<aryBed.Length;i++)
{
aryBed[i].Height = BedHeight;
aryBed[i].Width = BedWidth;
if(i<RowBedCount)aryBed[i].Top = 0;
else aryBed[i].Top = aryBed[i-RowBedCount].Top + bed.Height+1; if((i%RowBedCount)==0)aryBed[i].Left = 0;
else aryBed[i].Left = aryBed[i-1].Left + bed.Width+1;
this.plBed.PerformLayout();
}
}
解决方案 »
- .Net 怎样引用第三方写好的接口(xx.dll)并实现中的方法。
- 怎么把TextBox里面的内容导出为txt啊
- 一个方法中返回数组的问题
- 全选框功能不能实现的问题,谢谢~
- 请问用C#编写Asp.Net程序时,如何设置一个Button为默认按钮?
- 请问一个关于OleDbDataAdapter 读取Excel文件的问题?
- 不知算不算难题!!!!!!!!!!!!!!!!!!!!!!!!!!
- FarPoint Spread for Windows Forms 如何不用数据库绑定实现表格嵌套!
- 紧急,VS2013的webbrowser控件不能用,往窗口上一拖放就假死
- 依赖项的问题,在线等待...
- 关于.Net的几点疑问
- 请高手看看这个设想行吗?关于线程交互的
{
//panel1 size改变触发。
在这里设床的位置大小和panel成1个固定的比例,就行了。
}
而且我想实现换行显示也不知道怎么办!比如我想添加几个后,换一行再添加呢?怎么实现呢?