public void LoadMonitors() { int index = 0; foreach (Screen screen in Screen.AllScreens) { ClockSettings clockSet = new ClockSettings(); int id = clockSet.tabScreen.Controls.IndexOfKey("tbResolution"); clockSet.tabScreen.Controls[id].Text = screen.Bounds.Width + " x " + screen.Bounds.Height; clockSettings.Add(clockSet); TabPage tabPage = new TabPage(); tabPage.Location = new Point(4, 22); tabPage.Name = "tabPage" + index; tabPage.Padding = new Padding(3); tabPage.Size = new Size(435, 203); tabPage.TabIndex = index; tabPage.Text = screen.DeviceName.Replace("\\\\.\\", string.Empty); tabPage.UseVisualStyleBackColor = true; tabPage.Controls.Add(clockSettings[index]); tabPages.Add(tabPage); tabControl1.Controls.Add(tabPages[index]); index++; } }
public void OneMonitor() { ClockSettings clockSet = new ClockSettings(); clockSettings.Add(clockSet); TabPage tabPage = new TabPage(); tabPage.Location = new Point(4, 22); tabPage.Name = "tabPage0"; tabPage.Padding = new Padding(3); tabPage.Size = new Size(435, 203); tabPage.TabIndex = 0; tabPage.Text = "The same configuration for all monitors"; tabPage.UseVisualStyleBackColor = true; tabPage.Controls.Add(clockSettings[0]); tabPages.Add(tabPage); tabControl1.Controls.Add(tabPages[0]); }