本文整理汇总了VB.NET中System.Console.CursorSize属性的典型用法代码示例。如果您正苦于以下问题:VB.NET Console.CursorSize属性的具体用法?VB.NET Console.CursorSize怎么用?VB.NET Console.CursorSize使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Console
的用法示例。
在下文中一共展示了Console.CursorSize属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Sample
' This example demonstrates the Console.CursorSize property.
Class Sample
Public Shared Sub Main()
Dim m0 As String = "This example increments the cursor size from " & _
"1% to 100%:" & vbCrLf
Dim m1 As String = "Cursor size = {0}%. (Press any key to continue...)"
Dim sizes As Integer() = {1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100}
Dim saveCursorSize As Integer
'
saveCursorSize = Console.CursorSize
Console.WriteLine(m0)
Dim size As Integer
For Each size In sizes
Console.CursorSize = size
Console.WriteLine(m1, size)
Console.ReadKey()
Next size
Console.CursorSize = saveCursorSize
End Sub
End Class
输出:
This example increments the cursor size from 1% to 100%: Cursor size = 1%. (Press any key to continue...) Cursor size = 10%. (Press any key to continue...) Cursor size = 20%. (Press any key to continue...) Cursor size = 30%. (Press any key to continue...) Cursor size = 40%. (Press any key to continue...) Cursor size = 50%. (Press any key to continue...) Cursor size = 60%. (Press any key to continue...) Cursor size = 70%. (Press any key to continue...) Cursor size = 80%. (Press any key to continue...) Cursor size = 90%. (Press any key to continue...) Cursor size = 100%. (Press any key to continue...)