ในการรับความสูงของหน้าต่างที่ใหญ่ที่สุดของ Console โค้ดจะเป็นดังนี้ -
ตัวอย่าง
using System;
public class Demo{
public static void Main(string[] args){
Console.WriteLine("Largest Window Height of the Console = "+Console.LargestWindowHeight);
}
} ผลลัพธ์
สิ่งนี้จะสร้างผลลัพธ์ต่อไปนี้ -
Largest Window Height of the Console = 58
ตัวอย่าง
เพื่อให้ได้ความกว้างหน้าต่างที่ใหญ่ที่สุดของคอนโซล รหัสมีดังนี้ -
using System;
public class Demo{
public static void Main(string[] args){
Console.WriteLine("Largest Window Width of the Console = "+Console.LargestWindowWidth);
}
} ผลลัพธ์
สิ่งนี้จะสร้างผลลัพธ์ต่อไปนี้ -
Largest Window Width of the Console = 190