Aracılığıyla paylaş


WorksheetBase.SetBackgroundPicture Yöntem

Arka plandaki grafiği çalışma sayfası için ayarlar.

Ad alanı:  Microsoft.Office.Tools.Excel
Derleme:  Microsoft.Office.Tools.Excel.v4.0.Utilities (Microsoft.Office.Tools.Excel.v4.0.Utilities.dll içinde)

Sözdizimi

'Bildirim
Public Sub SetBackgroundPicture ( _
    filename As String _
)
public void SetBackgroundPicture(
    string filename
)

Parametreler

Örnekler

Aşağıdaki kod örneği SetBackgroundPicture adlı bir dosyaya çalışma sayfasının arka plan görüntüsü ayarlama yöntemiimage1.jpg.

Bu örnek, bir belge düzeyinde özelleştirme için bulunur.

Private Sub SetWorksheetPicture()
    Dim backgroundFilePath As String = "C:\image1.jpg"
    If System.IO.File.Exists(backgroundFilePath) Then
        Me.SetBackgroundPicture("C:\image1.jpg")
    Else
        MsgBox("The file C:\image1.jpg does not exist.")
    End If
End Sub
private void SetWorksheetPicture()
{
    string backgroundFilePath = @"C:\image1.jpg";

    if (System.IO.File.Exists(backgroundFilePath))
    {
        this.SetBackgroundPicture(@"C:\image1.jpg");
    }
    else
    {
        MessageBox.Show(@"The file C:\image1.jpg does not exist.");
    }
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

WorksheetBase Sınıf

Microsoft.Office.Tools.Excel Ad Alanı