คุณสมบัติ WindowLeft ดูหรือตั้งค่าตำแหน่งซ้ายสุดของพื้นที่หน้าต่างคอนโซล เทียบกับบัฟเฟอร์หน้าจอ
ประกาศตัวแปรจำนวนเต็มเพื่อรับตำแหน่งซ้ายสุด:
int left;
ตอนนี้ ให้ใช้คุณสมบัติ Console.WindowLeft:
left = Console.WindowLeft
มาดูตัวอย่างที่สมบูรณ์กัน
ตัวอย่าง
using System;
class Demo
{
static void Main()
{
int left;
left = Console.WindowLeft;
Console.WriteLine("Left position of the Console window = " + left);
}
}
ผลลัพธ์
หมายเหตุ: ผลลัพธ์อาจแตกต่างกันไปตามตำแหน่งของหน้าต่างคอนโซล
Left position of the Console window = 0