Mega Code Archive

 
Categories / VB.Net / Development
 

Console SetWindowSize Method sets the height and width of the console window

Imports System Class Sample    Public Shared Sub Main()       Dim origWidth, width As Integer       Dim origHeight, height As Integer       origWidth = Console.WindowWidth       origHeight = Console.WindowHeight       Console.WriteLine(Console.WindowWidth)       Console.WriteLine(Console.WindowHeight)       Console.ReadKey(True)       width = origWidth / 2       height = origHeight / 2       Console.SetWindowSize(width, height)       Console.ReadKey(True)       Console.SetWindowSize(origWidth, origHeight)       Console.WriteLine(Console.WindowWidth)       Console.WriteLine(Console.WindowHeight)           End Sub  End Class