GiveFeedbackEventHandler デリゲートとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > GiveFeedbackEventHandler デリゲートの意味・解説 

GiveFeedbackEventHandler デリゲート

Control の GiveFeedback イベント処理するメソッド表します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Delegate Sub GiveFeedbackEventHandler
 ( _
    sender As Object, _
    e As GiveFeedbackEventArgs _
)
Dim instance As New GiveFeedbackEventHandler(AddressOf
 HandlerMethod)
public delegate void GiveFeedbackEventHandler
 (
    Object sender,
    GiveFeedbackEventArgs e
)
public delegate void GiveFeedbackEventHandler
 (
    Object^ sender, 
    GiveFeedbackEventArgs^ e
)
/** @delegate */
public delegate void GiveFeedbackEventHandler
 (
    Object sender, 
    GiveFeedbackEventArgs e
)
JScript では、デリゲート使用できますが、新規に宣言することはできません。

パラメータ

sender

イベントソース

e

イベント データ格納している GiveFeedbackEventArgs。

解説解説
使用例使用例

2 つListBox コントロールの間でドラッグ アンド ドロップ操作実行する例を次に示します。この例では、ドラッグ アクション開始したときに DoDragDrop メソッド呼び出されます。ドラッグ操作は、MouseDown イベント実行中のマウス位置から SystemInformation.DragSize を超えてマウス移動したときに開始されます。IndexFromPoint メソッドは、MouseDown イベントで、ドラッグする項目のインデックス判別するために使用します

この例では、ドラッグ アンド ドロップ操作カスタム カーソル使用する方法についても示します。この例では、2 つカーソル ファイル (3dwarro.cur3dwno.cur) がアプリケーション ディレクトリ内に存在していることを想定してます。なお、それぞれのファイルドラッグ用のカスタム カーソルドロップなしのカスタム カーソル表しますカスタム カーソルは、UseCustomCursorsCheckCheckBoxオンになっている場合使用されます。カスタム カーソルは、GiveFeedback イベント ハンドラ設定されます。

キーボードの状態は、右側ListBox の DragOver イベント ハンドラ評価されます。ドラッグ操作内容は、Shift キーCtrl キーAlt キー、または Ctrl + Alt キーの状態によって決まりますドロップ発生する ListBox 内の位置は、DragOver イベント時に判定されます。ドロップするデータStringない場合は、DragEventArgs.Effect が DragDropEffects.None に設定されます。最後にドロップステータスDropLocationLabelLabel表示されます。

右側ListBoxドロップするデータは、DragDrop イベント ハンドラ判定されます。また、String 値が ListBox該当する場所に追加されます。ドラッグ操作フォーム範囲超えて移動した場合ドラッグ アンド ドロップ操作は QueryContinueDrag イベント ハンドラキャンセルされます。

GiveFeedback イベントGiveFeedbackEventHandler デリゲート使用する例を次に示しますコード例全体については、DoDragDrop メソッドトピック参照してください

Private Sub ListDragSource_GiveFeedback(ByVal
 sender As Object, ByVal
 e As GiveFeedbackEventArgs) Handles ListDragSource.GiveFeedback

    ' Use custom cursors if the check box is checked.
    If (UseCustomCursorsCheck.Checked) Then

        ' Set the custom cursor based upon the effect.
        e.UseDefaultCursors = False
        If ((e.Effect And DragDropEffects.Move)
 = DragDropEffects.Move) Then
            Cursor.Current = MyNormalCursor
        Else
            Cursor.Current = MyNoDropCursor
        End If
    End If

End Sub
private void ListDragSource_GiveFeedback(object
 sender, System.Windows.Forms.GiveFeedbackEventArgs e) 
{
    // Use custom cursors if the check box is checked.
    if (UseCustomCursorsCheck.Checked) {

        // Sets the custom cursor based upon the effect.
        e.UseDefaultCursors = false;
        if ((e.Effect & DragDropEffects.Move) == DragDropEffects.Move)
            Cursor.Current = MyNormalCursor;
        else 
            Cursor.Current = MyNoDropCursor;
    }

}
void ListDragSource_GiveFeedback( Object^ /*sender*/, System::Windows::Forms::GiveFeedbackEventArgs^
 e )
{
   // Use custom cursors if the check box is checked.
   if ( UseCustomCursorsCheck->Checked )
   {
      // Sets the custom cursor based upon the effect.
      e->UseDefaultCursors = false;
      if ( (e->Effect & DragDropEffects::Move) == DragDropEffects::Move
 )
                  ::Cursor::Current = MyNormalCursor;
      else
                  ::Cursor::Current = MyNoDropCursor;
   }
}
private void listDragSource_GiveFeedback(Object
 sender, 
    System.Windows.Forms.GiveFeedbackEventArgs e)
{
    // Use custom cursors if the check box is checked.
    if (useCustomCursorsCheck.get_Checked()) {
        // Sets the custom cursor based upon the effect.
        e.set_UseDefaultCursors(false);
        if ((e.get_Effect() & DragDropEffects.Move) 
            == DragDropEffects.Move) {
            get_Cursor().set_Current(myNormalCursor);
        }
        else {
            get_Cursor().set_Current(myNoDropCursor);
        }
    }
} //listDragSource_GiveFeedback
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
System.Windows.Forms 名前空間
OnGiveFeedback
Control.GiveFeedback イベント
GiveFeedbackEventArgs クラス



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

辞書ショートカット

すべての辞書の索引

GiveFeedbackEventHandler デリゲートのお隣キーワード
検索ランキング

   

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



GiveFeedbackEventHandler デリゲートのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS