Console.BufferWidth Tulajdonság
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Lekéri vagy beállítja a pufferterület szélességét.
public:
static property int BufferWidth { int get(); void set(int value); };
public static int BufferWidth { [System.Runtime.Versioning.UnsupportedOSPlatform("android")] [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] [System.Runtime.Versioning.UnsupportedOSPlatform("ios")] [System.Runtime.Versioning.UnsupportedOSPlatform("tvos")] get; [System.Runtime.Versioning.SupportedOSPlatform("windows")] set; }
public static int BufferWidth { [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] get; [System.Runtime.Versioning.SupportedOSPlatform("windows")] set; }
public static int BufferWidth { get; set; }
[<get: System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<get: System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<get: System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<get: System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
[<set: System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member BufferWidth : int with get, set
[<get: System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<set: System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member BufferWidth : int with get, set
static member BufferWidth : int with get, set
Public Shared Property BufferWidth As Integer
Tulajdonság értéke
A pufferterület aktuális szélessége oszlopokban.
- Attribútumok
Kivételek
A halmazművelet értéke kisebb vagy egyenlő nullánál.
-vagy-
A halmazművelet értéke nagyobb vagy egyenlő az Int16.MaxValue értéknél.
-vagy-
A megadott művelet értéke kisebb, mint WindowLeft + WindowWidth.
A felhasználónak nincs engedélye a művelet végrehajtására.
I/O-hiba történt.
A beállított műveletet a rendszer nem Windows operációs rendszeren hívja meg.
Példák
Ez a példa a tulajdonságokat és BufferHeight a BufferWidth tulajdonságokat mutatja be. A példa egy 300 sorból és 85 oszlopból álló pufferméretre beállított operációsrendszer-ablak méreteit jelenti.
// This example demonstrates the Console.BufferHeight and
// Console.BufferWidth properties.
using System;
class Sample
{
public static void Main()
{
Console.WriteLine("The current buffer height is {0} rows.",
Console.BufferHeight);
Console.WriteLine("The current buffer width is {0} columns.",
Console.BufferWidth);
}
}
/*
This example produces the following results:
The current buffer height is 300 rows.
The current buffer width is 85 columns.
*/
// This example demonstrates the Console.BufferHeight and
// Console.BufferWidth properties.
open System
printfn $"The current buffer height is {Console.BufferHeight} rows."
printfn $"The current buffer width is {Console.BufferWidth} columns."
// This example produces the following results:
//
// The current buffer height is 300 rows.
// The current buffer width is 85 columns.
' This example demonstrates the Console.BufferHeight and
' Console.BufferWidth properties.
Class Sample
Public Shared Sub Main()
Console.WriteLine("The current buffer height is {0} rows.", _
Console.BufferHeight)
Console.WriteLine("The current buffer width is {0} columns.", _
Console.BufferWidth)
End Sub
End Class
'
'This example produces the following results:
'
'The current buffer height is 300 rows.
'The current buffer width is 85 columns.
'
Megjegyzések
Ha egy halmazművelet csökkenti a BufferWidth tulajdonság értékét, a rendszer eltávolítja a jobb szélső oszlopokat. Ha például az oszlopok száma 80-ról 60-ra csökken, az egyes sorok 60–79 oszlopa törlődik.