public Over_Form() { InitializeComponent(); PhysicalMemory mem = new PhysicalMemory(); mem.Retrieve(); prbar_RAM.MaximumValue = (int)(mem.TotalMemory / bytesInMegabyte); this.Location = SetPosition(); this.ShowInTaskbar = false; }
public uc_accelerator() { InitializeComponent(); mem.Retrieve(); controller.Retrieve(); sensor.Update(); prbar_ram_used.Maximum = (int)(mem.TotalMemory / bytesInMegabyte); for (int i = 0; i < controller.LogicalDisks.Count(); i++) { Hardware.LogicalDisk currentDisk = controller.LogicalDisks[i]; TabPage myTabPage = new TabPage(currentDisk.Name) { Size = new Size(380, 200), }; tab_storage.TabPages.Add(myTabPage); CircularProgressBar.CircularProgressBar prbar_usedSpace = new CircularProgressBar.CircularProgressBar { Location = new Point(5, 25), Size = new Size(125, 125), OuterColor = Color.Gainsboro, ProgressColor = Color.SteelBlue, OuterMargin = -30, OuterWidth = 30, ProgressWidth = 30, Maximum = 100, Value = 0, InnerColor = SystemColors.Control }; CircularProgressBar.CircularProgressBar prbar_freeSpace = new CircularProgressBar.CircularProgressBar { Location = new Point(220, 25), Size = new Size(125, 125), OuterColor = Color.Gainsboro, ProgressColor = Color.SteelBlue, OuterMargin = -30, OuterWidth = 30, ProgressWidth = 30, Maximum = 100, Value = 0, InnerColor = SystemColors.Control }; Label lb_space_used = new Label { AutoSize = true, Text = "Used:", Location = new Point(5, 5) }; Label lb_space_free = new Label { AutoSize = true, Text = "Free:", Location = new Point(215, 5) }; Label lb_space_usedValue = new Label { AutoSize = true, Text = "", Location = new Point(5, 155), Font = new Font("Century Gothic", 22, FontStyle.Regular), ForeColor = Color.Gray }; Label lb_space_freeValue = new Label { AutoSize = true, Text = "", Location = new Point(220, 155), Font = new Font("Century Gothic", 22, FontStyle.Regular), ForeColor = Color.Gray }; myTabPage.Controls.Add(prbar_usedSpace); myTabPage.Controls.Add(prbar_freeSpace); myTabPage.Controls.Add(lb_space_usedValue); myTabPage.Controls.Add(lb_space_freeValue); myTabPage.Controls.Add(lb_space_used); myTabPage.Controls.Add(lb_space_free); } }