private void cmdPrint_Click(object sender, EventArgs e) { using (var layout = new LayoutForm()) { layout.MapControl = Map as Map; layout.ShowDialog(this); } }
/// <summary> /// Handles the Click event of the PrintLayout control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void PrintLayoutClick(object sender, EventArgs e) { // In Mono show the dialog only if printers installed else show error message. if (Mono.IsRunningOnMono()) { if (!new PrinterSettings().IsValid) { MessageBox.Show(Msg.NoPrintersInstalled, Msg.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } using var layout = new LayoutForm(); layout.MapControl = App.Map as Map; layout.ShowDialog(); }
/// <summary> /// Handles the Click event of the PrintLayout control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void PrintLayout_Click(object sender, EventArgs e) { using (LayoutForm layout = new LayoutForm()) { layout.MapControl = App.Map as Map; layout.ShowDialog(); } }
/// <summary> /// Handles the Click event of the PrintLayout control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void PrintLayout_Click(object sender, EventArgs e) { // In Mono show the dialog only if printers installed else show error message. if (Mono.Mono.IsRunningOnMono()) { if (!new PrinterSettings().IsValid) { MessageBox.Show("No printers installed.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } using (var layout = new LayoutForm()) { layout.MapControl = App.Map as Map; layout.ShowDialog(); } }