Redo メソッドが呼び出された場合に、コントロールに再適用できるアクションの名前を取得します。
名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文
'宣言
Public ReadOnly Property RedoActionName As String
'使用
Dim instance As RichTextBox
Dim value As String
value = instance.RedoActionName
public string RedoActionName { get; }
public:
property String^ RedoActionName {
String^ get ();
}
/** @property */
public String get_RedoActionName ()
public function get RedoActionName () : String
プロパティ値
Redo メソッドが呼び出された場合に実行されるアクションの名前を表す文字列。
解説
このプロパティが空の文字列 ("") を返す場合は、コントロールに再適用できる操作はありません。このメソッドを使用すると、RichTextBox コントロールで最後に元に戻され、Redo メソッドが呼び出された場合にコントロールに再適用できるアクションを確認できます。CanRedo プロパティを使用して、コントロールに再適用できる操作があるかどうかを確認できます。
使用例
CanRedo プロパティと RedoActionName プロパティ、および Redo メソッドを使用して、テキストの削除以外の操作に対するやり直し操作を制限する方法を次のコード例に示します。この例では、フォームに RichTextBox コントロールが含まれていて、この例のコードが呼び出される前に RichTextBox 内で何らかの操作が実行され、その操作が元に戻されている必要があります。
Private Sub RedoAllButDeletes()
' Determines if a Redo operation can be performed.
If richTextBox1.CanRedo = True Then
' Determines if the redo operation deletes text.
If richTextBox1.RedoActionName <> "Delete" Then
' Perform the redo.
richTextBox1.Redo()
End If
End If
End Sub
private void RedoAllButDeletes()
{
// Determines if a Redo operation can be performed.
if(richTextBox1.CanRedo == true)
{
// Determines if the redo operation deletes text.
if (richTextBox1.RedoActionName != "Delete")
// Perform the redo.
richTextBox1.Redo();
}
}
private:
void RedoAllButDeletes()
{
// Determines if a Redo operation can be performed.
if ( richTextBox1->CanRedo == true )
{
// Determines if the redo operation deletes text.
if ( !richTextBox1->RedoActionName->Equals( "Delete" ) )
// Perform the redo.
richTextBox1->Redo();
}
}
private void RedoAllButDeletes()
{
// Determines if a Redo operation can be performed.
if (richTextBox1.get_CanRedo() == true) {
// Determines if the redo operation deletes text.
if (!(richTextBox1.get_RedoActionName().Equals("Delete"))) {
// Perform the redo.
richTextBox1.Redo();
}
}
} //RedoAllButDeletes
プラットフォーム
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 2.0、1.1、1.0
参照
関連項目
RichTextBox クラス
RichTextBox メンバ
System.Windows.Forms 名前空間
RichTextBox.CanRedo プロパティ
Redo