คุณสมบัติ WindowsLeft รับหรือตั้งค่าตำแหน่งซ้ายสุดของพื้นที่หน้าต่างคอนโซลที่สัมพันธ์กับบัฟเฟอร์หน้าจอ
ประกาศตัวแปรจำนวนเต็มเพื่อรับตำแหน่งซ้ายสุด
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