private void Main_ResizeEnd(object sender, EventArgs e) { if (CurSize.Height > 0 && CurSize.Width > 0 && OpenedArchives.Parent.ClientSize.Height > 0 && OpenedArchives.Parent.ClientSize.Width > 0) { OpenedArchives.Height = (int)Math.Round(TabHeightRatio * (decimal)OpenedArchives.Parent.ClientSize.Height); OpenedArchives.Width = (int)Math.Round(TabWidthRatio * (decimal)OpenedArchives.Parent.ClientSize.Width); } OpenedArchives.Refresh(); if (OpenedFiles != null && OpenedFiles.Length > 0) { foreach (var Openedfile in OpenedFiles) { Openedfile.Tab.Size = OpenedArchives.Size; Openedfile.Tab.Refresh(); Openedfile.tree.Size = Openedfile.Tab.Size; Openedfile.tree.Refresh(); } } Bitmap picImage = new Bitmap(CatLoad.Image); CatLoad.Location = new Point((CatLoad.Parent.ClientSize.Width / 2) - (picImage.Width / 2), (CatLoad.Parent.ClientSize.Height / 2) - (picImage.Height / 2)); CatLoad.Refresh(); CurSize = OpenedArchives.Parent.ClientSize; }
public Main() { InitializeComponent(); CurSize = this.ClientSize; Bitmap picImage = new Bitmap(CatLoad.Image); CatLoad.Location = new Point((CatLoad.Parent.ClientSize.Width / 2) - (picImage.Width / 2), (CatLoad.Parent.ClientSize.Height / 2) - (picImage.Height / 2)); CatLoad.Refresh(); TabWidthRatio = (decimal)OpenedArchives.Size.Width / (decimal)CurSize.Width; TabHeightRatio = (decimal)OpenedArchives.Size.Height / (decimal)CurSize.Height; }