Button.CopyPicture Yöntem
Kopya Button Panoya olarak bir resim.
Ad alanı: Microsoft.Office.Tools.Excel.Controls
Derleme: Microsoft.Office.Tools.Excel.v4.0.Utilities (Microsoft.Office.Tools.Excel.v4.0.Utilities.dll içinde)
Sözdizimi
'Bildirim
Public Function CopyPicture ( _
Appearance As XlPictureAppearance, _
Format As XlCopyPictureFormat _
) As Object
public Object CopyPicture(
XlPictureAppearance Appearance,
XlCopyPictureFormat Format
)
Parametreler
- Appearance
Tür: Microsoft.Office.Interop.Excel.XlPictureAppearance
Resmi nasıl kopyalanacağı belirtir.
- Format
Tür: Microsoft.Office.Interop.Excel.XlCopyPictureFormat
Resim biçimi.Değer kabul xlPicture.
Dönüş Değeri
Tür: System.Object
true kopya başarılı olursa; Aksi takdirde, false.
Açıklamalar
İsteğe bağlı parametreler
İsteğe bağlı parametreler hakkında daha fazla bilgi için bkz: Office Çözümlerinde İsteğe Bağlı Parametreler.
Örnekler
Aşağıdaki kod örneği gösterir bir Button Denetim kendi kullanıcı it. tıklattığında Pano'ya kopyalar Click Olay işleyicisi düğmesini çağrıların CopyPicture yöntemi bitmap Pano düğmeyi kopyalamak için
Bu örnek, bir belge düzeyinde özelleştirme için bulunur.
Private Sub CopyControlAsPicture()
Dim CopyButton As Microsoft.Office.Tools.Excel.Controls.Button = _
Me.Controls.AddButton(Me.Range("B2", "D3"), "CopyButton")
CopyButton.Text = "Click to copy this control"
AddHandler CopyButton.Click, AddressOf copyButtonPicture_Click
End Sub
Private Sub CopyButtonPicture_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim ClickedButton As Microsoft.Office.Tools.Excel.Controls.Button = _
CType(sender, Microsoft.Office.Tools.Excel.Controls.Button)
ClickedButton.CopyPicture(Excel.XlPictureAppearance.xlScreen, _
Excel.XlCopyPictureFormat.xlBitmap)
End Sub
private void CopyControlAsPicture()
{
Microsoft.Office.Tools.Excel.Controls.Button copyButton =
this.Controls.AddButton(this.Range["B2", "D3"],
"copyButton");
copyButton.Text = "Click to copy this control";
copyButton.Click += new EventHandler(copyButtonPicture_Click);
}
void copyButtonPicture_Click(object sender, EventArgs e)
{
Microsoft.Office.Tools.Excel.Controls.Button clickedButton =
(Microsoft.Office.Tools.Excel.Controls.Button)sender;
clickedButton.CopyPicture(
Excel.XlPictureAppearance.xlScreen,
Excel.XlCopyPictureFormat.xlBitmap);
}
.NET Framework Güvenliği
- Anında arayanlar için tam güven. Bu üye kısmen güvenilen kodla kullanılamaz. Daha fazla bilgi için bkz. kısmen güvenilir kod tarafından Kitaplıklar kullanma.