本文整理匯總了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;
}
}
}