Button.TopLeftCell Özellik
Alır bir Range altında sol üst köşesinde bulunan hücre temsil eden nesne Button.
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 ReadOnly Property TopLeftCell As Range
public Range TopLeftCell { get; }
Özellik Değeri
Tür: Microsoft.Office.Interop.Excel.Range
A Range altında sol üst köşesinde bulunan hücre temsil eden nesne Button.
Örnekler
Aşağıdaki kod örnek TopLeftCell ve BottomRightCell sol üst ve alt özellikler sağa hücre olarak yapılan bir Button denetim.Click Olay işleyicisi düğmesinin sol ve alt sağ üst hücreyi kenarlıklarını kırmızı renkler.
Belge düzeyi özelleştirmesi için örnektir.
Private Sub MarkCornerCells()
Dim CornerButton As Microsoft.Office.Tools.Excel.Controls.Button = _
Me.Controls.AddButton(65, 45, 100, 25, "CornerButton")
CornerButton.Text = "Click to highlight corners."
AddHandler CornerButton.Click, AddressOf CornerButton_Click
End Sub
Private Sub CornerButton_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.BottomRightCell.Borders.Color = _
ColorTranslator.ToOle(Color.Red)
ClickedButton.TopLeftCell.Borders.Color = _
ColorTranslator.ToOle(Color.Red)
End Sub
private void MarkCornerCells()
{
Microsoft.Office.Tools.Excel.Controls.Button button1 =
this.Controls.AddButton(65, 45, 100, 25,
"button1");
button1.Text = "Click to highlight corners.";
button1.Click += new EventHandler(button1_Click);
}
void button1_Click(object sender, EventArgs e)
{
Microsoft.Office.Tools.Excel.Controls.Button clickedButton =
(Microsoft.Office.Tools.Excel.Controls.Button)sender;
clickedButton.BottomRightCell.Borders.Color =
ColorTranslator.ToOle(Color.Red);
clickedButton.TopLeftCell.Borders.Color =
ColorTranslator.ToOle(Color.Red);
}
.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üvenilen Koddan Kitaplıkları Kullanma.