fixed #1777: Force activate print dialog

This commit is contained in:
Jaex 2016-08-14 00:43:31 +03:00
parent 5b077d4871
commit 4955204661
2 changed files with 7 additions and 4 deletions

View file

@ -115,6 +115,7 @@ private void InitializeComponent()
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.Name = "PrintForm";
this.Shown += new System.EventHandler(this.PrintForm_Shown);
((System.ComponentModel.ISupportInitialize)(this.nudMargin)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();

View file

@ -23,6 +23,7 @@ You should have received a copy of the GNU General Public License
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using ShareX.HelpersLib.Properties;
using System;
using System.Drawing;
@ -45,10 +46,6 @@ public PrintForm(Image img, PrintSettings settings, bool previewOnly = false)
LoadSettings();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing)
@ -67,6 +64,11 @@ protected override void Dispose(bool disposing)
base.Dispose(disposing);
}
private void PrintForm_Shown(object sender, EventArgs e)
{
this.ForceActivate();
}
private void LoadSettings()
{
nudMargin.SetValue(printSettings.Margin);