Class BorderCollection

Class BorderCollection

Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)

Aspose.Cells.Border nesnelerinin bir koleksiyonunu kapsüller.

public class BorderCollection

Miras

objectBorderCollection

Miras Alınan Üyeler

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Örnekler


//Workbook nesnesi oluşturma
Workbook workbook = new Workbook();

//Excel nesnesine yeni bir çalışma sayfası ekleme
workbook.Worksheets.Add();

//Yeni eklenen çalışma sayfasının referansını sayfa indeksini geçerek alma
Worksheet worksheet = workbook.Worksheets[0];

//Çalışma sayfasından "A1" hücresine erişme
Cell cell = worksheet.Cells["A1"];

//"A1" hücresine bir değer ekleme
cell.PutValue("Aspose'u Ziyaret Edin!");

//Hücrenin stilini alma
Style style = cell.GetStyle();

//Üst kenarın çizgi stilini ayarlama
style.Borders[BorderType.TopBorder].LineStyle = CellBorderType.Thick;

//Üst kenarın rengini ayarlama
style.Borders[BorderType.TopBorder].Color = Color.Black;

//Alt kenarın çizgi stilini ayarlama
style.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thick;

//Alt kenarın rengini ayarlama
style.Borders[BorderType.BottomBorder].Color = Color.Black;

//Sol kenarın çizgi stilini ayarlama
style.Borders[BorderType.LeftBorder].LineStyle = CellBorderType.Thick;

//Sol kenarın rengini ayarlama
style.Borders[BorderType.LeftBorder].Color = Color.Black;

//Sağ kenarın çizgi stilini ayarlama
style.Borders[BorderType.RightBorder].LineStyle = CellBorderType.Thick;

//Sağ kenarın rengini ayarlama
style.Borders[BorderType.RightBorder].Color = Color.Black;

cell.SetStyle(style);

//Excel dosyasını kaydetme
workbook.Save("book1.xls");

'Workbook nesnesi oluşturma
Dim workbook As Workbook = New Workbook()

'Workbook nesnesine yeni bir çalışma sayfası ekleme
workbook.Worksheets.Add()

'Yeni eklenen çalışma sayfasının referansını sayfa indeksini geçerek alma
Dim worksheet As Worksheet = workbook.Worksheets(0)

alışma sayfasından "A1" hücresine erişme
Dim cell As Cell = worksheet.Cells("A1")

'Hücreye bir değer ekleme
cell.PutValue("Aspose'u Ziyaret Edin!")

Dim style as Style = cell.GetStyle()

st kenarın çizgi stilini ayarlama
style.Borders(BorderType.TopBorder).LineStyle = CellBorderType.Thick

st kenarın rengini ayarlama
style.Borders(BorderType.TopBorder).Color = Color.Black

'Alt kenarın çizgi stilini ayarlama
style.Borders(BorderType.BottomBorder).LineStyle = CellBorderType.Thick

'Alt kenarın rengini ayarlama
style.Borders(BorderType.BottomBorder).Color = Color.Black

'Sol kenarın çizgi stilini ayarlama
style.Borders(BorderType.LeftBorder).LineStyle = CellBorderType.Thick

'Sol kenarın rengini ayarlama
style.Borders(BorderType.LeftBorder).Color = Color.Black

'Sağ kenarın çizgi stilini ayarlama
style.Borders(BorderType.RightBorder).LineStyle = CellBorderType.Thick

'Sağ kenarın rengini ayarlama
style.Borders(BorderType.RightBorder).Color = Color.Black

cell.SetStyle(style)

'Excel dosyasını kaydetme
workbook.Save("book1.xls")

Özellikler

DiagonalColor

Diyagonal çizgilerin System.Drawing.Color’ını alır veya ayarlar.

public Color DiagonalColor { get; set; }

Özellik Değeri

Color

DiagonalStyle

Diyagonal çizgilerin stilini alır veya ayarlar.

public CellBorderType DiagonalStyle { get; set; }

Özellik Değeri

CellBorderType

this[BorderType]

Belirtilen indeksteki Aspose.Cells.Border öğesini alır.

public Border this[BorderType borderType] { get; }

Özellik Değeri

Border

Metotlar

SetColor(Color)

Koleksiyondaki tüm kenarların System.Drawing.Color’ını ayarlar.

public void SetColor(Color color)

Parametreler

color Color

Kenarların System.Drawing.Color’ı.

SetStyle(CellBorderType)

Koleksiyondaki tüm kenarların stilini ayarlar.

public void SetStyle(CellBorderType style)

Parametreler

style CellBorderType

Kenarların stili.

 Türkçe