ab56a9bcf7
SVN-Revision: r240
64 lines
1.4 KiB
C#
64 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Lskj.ProductPlatform2
|
|
{
|
|
public partial class PageBar : UserControl
|
|
{
|
|
public List<ToolButton> ToolButtonList = new List<ToolButton>();//全部选项
|
|
public Dictionary<int, List<ToolButton>> bonuttPaging = new Dictionary<int, List<ToolButton>>();//每页对于的选项
|
|
|
|
|
|
public PageBar()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void addButtons(List<ToolButton> ToolButtons)
|
|
{
|
|
|
|
|
|
int panelWidth = this.panelDisplay1.Width;
|
|
int panelheight = this.panelDisplay1.Height;
|
|
int tbx = 5;
|
|
int tby = 5;
|
|
int NumberPages = 0;
|
|
|
|
foreach (ToolButton tb in ToolButtons)
|
|
{
|
|
|
|
if (panelWidth > (tbx + tb.Width))
|
|
{
|
|
//换列
|
|
tbx += 5;
|
|
}
|
|
else
|
|
{
|
|
//换行
|
|
tbx = 5;
|
|
tby += tb.Height + 5;
|
|
}
|
|
tb.Location = new Point(tbx, tby);
|
|
tbx += tb.Width;
|
|
|
|
panelDisplay1.Controls.Add(tb);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|