本文整理汇总了C#中System.Windows.Forms.TabPage.SetAutoScrollMargin方法的典型用法代码示例。如果您正苦于以下问题:C# TabPage.SetAutoScrollMargin方法的具体用法?C# TabPage.SetAutoScrollMargin怎么用?C# TabPage.SetAutoScrollMargin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TabPage
的用法示例。
在下文中一共展示了TabPage.SetAutoScrollMargin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResizeChildWindowsFollow
private void ResizeChildWindowsFollow(TabPage Tab)
{
if(Tab.Controls.Count > 0)
{
int WindowCount = Tab.Controls.Count;
int Column,Row;
Row = (int)Math.Floor((WindowCount-1)/MaxCol)+1;
if(WindowCount < MaxCol)
{
Column = WindowCount;
}
else
{
Column = MaxCol;
}
Tab.SetAutoScrollMargin(0,0);
//Tab.ScrollControlIntoView(Tab);
int Width = (this.ClientSize.Width-7)/Column;
int Height;
int MaxHeight = 0, tmp;
ListForm.ListForm lf;
for(int i=0;i<Tab.Controls.Count;i++)
{
lf = (ListForm.ListForm)Tab.Controls[i];
tmp = lf.ListBox.ItemHeight * (lf.ListBox.Items.Count+3) + lf.Caption.Height;
if(MaxHeight < tmp)
{
MaxHeight = tmp;
}
}
Height = MaxHeight;
int curRow;
int Mod;
for(int i=0;i<WindowCount;i++)
{
Tab.Controls[i].Width = Width;
Tab.Controls[i].Height = Height;
curRow = Math.DivRem(i,Column,out Mod);
Tab.Controls[i].Left = Mod*Width;
Tab.Controls[i].Top = curRow*Height;
}
}
}
示例2: ResizeChildWindowsAuto
private void ResizeChildWindowsAuto(TabPage Tab)
{
if(Tab.Controls.Count > 0)
{
int WindowCount = Tab.Controls.Count;
int Column,Row;
Row = (int)Math.Floor((WindowCount-1)/MaxCol)+1;
if(WindowCount < MaxCol)
{
Column = WindowCount;
}
else
{
Column = MaxCol;
}
Tab.SetAutoScrollMargin(0,0);
int Width = (this.ClientRectangle.Width-7)/Column;
int Height = (this.ClientRectangle.Height-this.statusBarEx1.Height-27)/Row;
int curRow;
int Mod;
for(int i=0;i<WindowCount;i++)
{
Tab.Controls[i].Width = Width;
Tab.Controls[i].Height = Height;
curRow = Math.DivRem(i,Column,out Mod);
Tab.Controls[i].Left = Mod*Width;
Tab.Controls[i].Top = curRow*Height;
}
}
}