public void updateBrowsers() { SuspendLayout(); browsers = BrowserFinder.find().Where(b => !Settings.Default.HideBrowsers.Contains(b.Identifier)).ToList(); int i = 0; int width = 0; for (int k = Controls.Count - 1; k >= 0; k--) { Control c = Controls[k]; if (c is BrowserUC) { Controls.RemoveAt(k); } } // add browserUC objects to the form foreach (var browser in browsers) { var buc = new BrowserUC(browser, i); width = buc.Width; // buc.Width = 128*dpi Scale buc.Left = width * i++; buc.Click += browser_click; this.Controls.Add(buc); } ResumeLayout(); buc.Left = i * width; btn_help.Left = i * width; btn_help.Top = buc.Height - btn_help.Height; // this.Width = i * 128 + 20 + 20; }
private void Form1_Load(object sender, EventArgs e) { int width = 128; // add browserUC objects to the form int i = 0; foreach (var browser in browsers) { var buc = new BrowserUC(browser, i); width = buc.Width; // buc.Width = 128*dpi Scale buc.Left = width * i++; buc.Click += browser_click; this.Controls.Add(buc); } // resize the form //this.Width = i * 128 + 20 + 20; this.AutoSize = true; this.KeyPreview = true; this.Text = Program.url; // set the form icon from .exe file icon this.Icon = IconExtractor.fromFile(Application.ExecutablePath); // add vertical buttons to right of form this.Controls.Add(new ButtonsUC() { Left = i * width }); // create a wildcard rule for this domain (always button) _alwaysRule = generate_rule(Program.url); // check for new version if (Settings.Default.last_version != "nope") { btn_help.BackgroundImage = Resources.update_available; btn_help.Click -= btn_help_Click; btn_help.Click += btn_update_click; } center_me(); }
private void Form1_Load(object sender, EventArgs e) { int i = 0; foreach (var browser in browsers) { var buc = new BrowserUC(browser, i); buc.Left = 128 * i++; buc.Click += browser_click; this.Controls.Add(buc); } this.Width = i * 128 + 20 + 20; this.KeyPreview = true; this.Text = Program.url; this.Icon = IconExtractor.fromFile(Application.ExecutablePath); add_button("About", show_about, 0); add_button("Settings", show_setting, 1); center_me(); }
private void Form1_Load(object sender, EventArgs e) { // add browserUC objects to the form int i = 0; foreach (var browser in browsers) { var buc = new BrowserUC(browser, i); buc.Left = 128 * i++; buc.Click += browser_click; this.Controls.Add(buc); } // resize the form //this.Width = i * 128 + 20 + 20; this.AutoSize = true; this.KeyPreview = true; this.Text = Program.url; // set the form icon from .exe file icon this.Icon = IconExtractor.fromFile(Application.ExecutablePath); // add vertical buttons to right of form this.Controls.Add(new ButtonsUC() { Left = i * 128 }); // create a wildcard rule for this domain (always button) _alwaysRule = generate_rule(Program.url); // check for new version if (Settings.Default.last_version != "nope") { btn_help.BackgroundImage = Resources.update_available; btn_help.Click -= btn_help_Click; btn_help.Click += btn_update_click; } center_me(); }
private void Form1_Load(object sender, EventArgs e) { int i = 0; foreach(var browser in browsers) { var buc = new BrowserUC(browser,i); buc.Left = 128 * i++; buc.Click += browser_click; this.Controls.Add(buc); } this.Width = i * 128 + 20 + 20; this.KeyPreview = true; this.Text = Program.url; this.Icon = IconExtractor.fromFile(Application.ExecutablePath); add_button("About", show_about, 0); add_button("Settings", show_setting, 1); center_me(); }