PageSetupDialog.ShowNetwork Özellik

Tanım

düğmesinin görünür olup olmadığını belirten bir değer alır veya ayarlar.

C#
public bool ShowNetwork { get; set; }

Özellik Değeri

true düğmesi görünür durumdaysa; aksi takdirde , false. Varsayılan değer: true.

Örnekler

Aşağıdaki kod örneği, , PrinterSettingsve ShowNetwork özelliklerini kullanmayı PageSettingsgösterirPageSetupDialog. Bu örneği çalıştırmak için, adlı , ListBox1ListBox adlı ve adlı Button1bir Button öğesini içeren bir PageSetupDialogPageSetupDialog1forma yerleştirin. Düğmenin tıklama olayının bu örnekteki olay işleme yöntemine bağlı olduğundan emin olun.

C#

//This method displays a PageSetupDialog object. If the
// user clicks OK in the dialog, selected results of
// the dialog are displayed in ListBox1.
private void Button1_Click(System.Object sender, System.EventArgs e)
{

    // Initialize the dialog's PrinterSettings property to hold user
    // defined printer settings.
    PageSetupDialog1.PageSettings =
        new System.Drawing.Printing.PageSettings();

    // Initialize dialog's PrinterSettings property to hold user
    // set printer settings.
    PageSetupDialog1.PrinterSettings =
        new System.Drawing.Printing.PrinterSettings();

    //Do not show the network in the printer dialog.
    PageSetupDialog1.ShowNetwork = false;

    //Show the dialog storing the result.
    DialogResult result = PageSetupDialog1.ShowDialog();

    // If the result is OK, display selected settings in
    // ListBox1. These values can be used when printing the
    // document.
    if (result == DialogResult.OK)
    {
        object[] results = new object[]{ 
            PageSetupDialog1.PageSettings.Margins, 
            PageSetupDialog1.PageSettings.PaperSize, 
            PageSetupDialog1.PageSettings.Landscape, 
            PageSetupDialog1.PrinterSettings.PrinterName, 
            PageSetupDialog1.PrinterSettings.PrintRange};
        ListBox1.Items.AddRange(results);
    }
}

Şunlara uygulanır

Ürün Sürümler
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Ayrıca bkz.