private void BitcoinDonateDialog_Load(object sender, EventArgs e) { if (Runtime.DesignMode) { return; } LayoutSetting.Invalidate(this); textBox_address.Text = Address; }
private void ImageEditForm_Load(object sender, EventArgs e) { LayoutSetting.Invalidate(this); var data = File.ReadAllBytes(_filePath); if (data == null) { return; } var img = ImageUtil.FromByteArray(data); if (img == null) { return; } Rectangle workingArea = Screen.GetWorkingArea(this); if (img.Width >= workingArea.Width - 18 || img.Height >= workingArea.Width - 64) { Width = workingArea.Width; Height = workingArea.Height; Location = new Point(workingArea.Left, workingArea.Top); } else { Width = img.Width + 18; Height = img.Height + 64; int x = workingArea.Width / 2 - Width / 2; int y = workingArea.Height / 2 - Height / 2; Location = new Point(x, y); } _canvas = new Canvas(img); _canvas.OnDrawAction += canvas_OnDrawAction; _canvas.Mode = CaptureSetting.EditDrawMode; _canvas.Color = CaptureSetting.EditLineColor; _canvas.LineSize = CaptureSetting.EditLineSize; panel_canvas.Controls.Add(_canvas); ChangeCanvasCursor(); colorPicker.OnChangedColor += colorPicker_OnChangedColor; comboBox_type.DataSource = Enum.GetValues(typeof(DrawMode)); comboBox_type.SelectedItem = CaptureSetting.EditDrawMode; colorPicker.Color = CaptureSetting.EditLineColor; numericUpDown_size.Value = CaptureSetting.EditLineSize; _isLoaded = true; }
private void ToastMessageForm_Load(object sender, EventArgs e) { LayoutSetting.Invalidate(this); var data = File.ReadAllBytes(_filePath); if (data == null) { return; } var img = ImageUtil.FromByteArray(data); if (img == null) { return; } int resizeWidth = img.Width; int resizeHeight = img.Height; int width = Width - 2; if (resizeWidth > width) { float per = (float)width / img.Width; resizeWidth = (int)(per * img.Width); resizeHeight = (int)(per * img.Height); } int height = Height - 2 - 20; if (resizeHeight > height) { float per = (float)height / img.Height; resizeWidth = (int)(per * img.Width); resizeHeight = (int)(per * img.Height); } pictureBox.Width = resizeWidth; pictureBox.Height = resizeHeight; pictureBox.Image = img; int x = (width / 2) - (pictureBox.Width / 2) + 1; int y = (height / 2) - (pictureBox.Height / 2) + 1; pictureBox.Location = new Point(x, y); Rectangle workingArea = Screen.GetWorkingArea(this); Location = new Point(workingArea.Right - Size.Width - 5, workingArea.Bottom - Size.Height - 5); }
private void AboutDialog_Load(object sender, EventArgs e) { if (Runtime.DesignMode) { return; } LayoutSetting.Invalidate(this); var version = Assembly.GetExecutingAssembly().GetName().Version; label_desc.Text = string.Format(label_desc.Text, version.ToString()); }
private void SettingForm_Load(object sender, EventArgs e) { if (Runtime.DesignMode) { return; } LayoutSetting.Invalidate(this); // Load From Settings LoadGeneralSetting(); LoadLayoutSetting(); LoadCaptureSetting(); // Hide TabControl Header tabControl.Appearance = TabAppearance.FlatButtons; tabControl.ItemSize = new Size(0, 1); tabControl.SizeMode = TabSizeMode.Fixed; // Listview Setting for (int i = 0; i < listView.Items.Count; i++) { var li = listView.Items[i]; if (i == 0) { li.Tag = tabPage_general; } else if (i == 1) { li.Tag = tabPage_layout; } else if (i == 2) { li.Tag = tabPage_capture; } else if (i == 3) { li.Tag = tabPage_record; } else if (i == 4) { li.Tag = tabPage_hotKey; } } foreach (ListViewItem li in listView.Items) { var tag = li.Tag as string; if (tag == "General") { li.Tag = tabPage_general; } else if (tag == "Layout") { li.Tag = tabPage_layout; } else if (tag == "Capture") { li.Tag = tabPage_capture; } else if (tag == "Record") { li.Tag = tabPage_record; } else if (tag == "HotKey") { li.Tag = tabPage_hotKey; } } listView.Items[0].Focused = true; listView.Items[0].Selected = true; _isLoaded = true; }