Console.CursorSize プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Console.CursorSize プロパティの意味・解説 

Console.CursorSize プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

文字セル内のカーソルの高さを取得または設定します

名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Shared Property CursorSize
 As Integer
Dim value As Integer

value = Console.CursorSize

Console.CursorSize = value
public static int CursorSize
 { get; set; }
/** @property */
public static int get_CursorSize
 ()

/** @property */
public static void set_CursorSize
 (int value)

プロパティ
文字セルの高さに対す割合表されカーソルサイズプロパティ値の範囲は、1 ~ 100 です。

例外例外
例外種類条件

ArgumentOutOfRangeException

設定操作指定された値が 1 より小さいか、100超えてます。

SecurityException

ユーザーに、この操作実行するためのアクセス許可がありません。

IOException

I/O エラー発生しました

解説解説
使用例使用例

CursorSize プロパティ使用例次に示します。この例では、コンソール キー押されるたびにカーソルサイズ増やし終了前に元のサイズ戻します

' This example demonstrates the Console.CursorSize property.
Imports System
Imports Microsoft.VisualBasic

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 'Main
End Class 'Sample
'
'This example produces the following results:
'
'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...)
'
// This example demonstrates the Console.CursorSize property.
using System;

class Sample 
{
    public static void Main()
 
    {
    string m0 = "This example increments the cursor size
 from 1% to 100%:\n";
    string m1 = "Cursor size = {0}%. (Press any key to continue...)";
    int[] sizes = {1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100};
    int saveCursorSize;
//
    saveCursorSize = Console.CursorSize;
    Console.WriteLine(m0);
    foreach (int size in
 sizes)
        {
        Console.CursorSize = size;
        Console.WriteLine(m1, size);
        Console.ReadKey();
        }
    Console.CursorSize = saveCursorSize;
    }
}
/*
This example produces the following results:

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...)

*/
// This example demonstrates the Console.CursorSize property.
using namespace System;
int main()
{
   String^ m0 = "This example increments the cursor size from 1% to 100%:\n";
   String^ m1 = "Cursor size = {0}%. (Press any key to continue...)";
   array<Int32>^sizes = {1,10,20,30,40,50,60,70,80,90,100};
   int saveCursorSize;
   
   //
   saveCursorSize = Console::CursorSize;
   Console::WriteLine( m0 );
   System::Collections::IEnumerator^ myEnum = sizes->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      int size =  *safe_cast<Int32^>(myEnum->Current);
      Console::CursorSize = size;
      Console::WriteLine( m1, size );
      Console::ReadKey();
   }

   Console::CursorSize = saveCursorSize;
}

/*
This example produces the following results:

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...)

*/
// This example demonstrates the Console.CursorSize property.

import System.*;

class Sample
{
    public static void main(String[]
 args)
    {
        String m0 = "This example increments the cursor size from 1% to 100%:\n";
        String m1 = "Cursor size = {0}%. (Press any key to continue...)";
        int sizes[] =  { 1, 10, 20, 30, 40, 50, 60, 70, 80, 90,
 100 };
        int saveCursorSize;
        //
        saveCursorSize = Console.get_CursorSize();
        Console.WriteLine(m0);

        for (int iCtr = 0; iCtr < sizes.get_Length();
 iCtr++) {
            int size = sizes[iCtr];
            Console.set_CursorSize(size);
            Console.WriteLine(m1, System.Convert.ToString(size));
            Console.ReadKey();
        }
        Console.set_CursorSize(saveCursorSize);
    } //main
} //Sample
/*
This example produces the following results:

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...)

*/
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Console.CursorSize プロパティ」の関連用語

Console.CursorSize プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Console.CursorSize プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS