[Visual Basic] Public Property ButtonClearAll As System.Windows.Forms.ToolStripButton
[C#]
public System.Windows.Forms.ToolStripButton ButtonClearAll {get; set;}
プロパティ値
System.Windows.Forms.ToolStripButton 型の値
解説
「すべてのオブジェクトをクリア」用の ToolStripButton コントロールを示します。
ToolBarAnnotation が持つ任意のボタンの、詳細な設定やクリックイベント取得が可能です。
例
(1) 「すべてのオブジェクトをクリア」ボタンのイメージを変更する。
[Visual Basic.NET]
ToolBarAnnotation1.ButtonClearAll.Image = Image.FromFile("c:\images\button_img1.bmp")
[Visual C#.NET]
toolBarAnnotation1.ButtonClearAll.Image = Image.FromFile("c:\\images\\button_img1.bmp");
(2) 「選択」ボタンのクリックイベントを取得する。* ToolBarAnnotation コントロールの ItemClicked イベント内で、クリックされたボタンが目的のボタンだったら必要な処理を行う
[Visual Basic.NET]
Private Sub ToolBarAnnotation1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ToolBarAnnotation1.ItemClicked
If e.ClickedItem Is ToolBarAnnotation1.ButtonSelect Then 'クリックされたボタンが「選択」ボタン
'イベント発生で処理する内容をここに記載
End If
End Sub
[Visual C#.NET]
private void toolBarAnnotation1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
if (e.ClickedItem == toolBarAnnotation1.ButtonSelect)//クリックされたボタンが「選択」ボタン
{
//イベント発生で処理する内容をここに記載
}
}
(3) 「選択」ボタンのマウスアップイベントを発生させ、取得する。
[Visual Basic.NET] ※FormLoad イベント内などで、ButtonSelect のマウスアップイベントのデリゲートを設定しておく AddHandler ToolBarAnnotation1.ButtonSelect.MouseUp, AddressOf ButtonSelect_MouseUp 'イベントハンドラデリゲート Private Sub ButtonSelect_MouseUp(ByVal sender As System.Object, ByVal e As System.EventArgs) 'イベント発生で処理する内容をここに記載 End Sub [Visual C#.NET] ※FormLoad イベント内などで、ButtonSelect のマウスアップイベントのデリゲートを設定しておく toolBarAnnotation1.ButtonSelect.MouseUp += new MouseEventHandler(ButtonSelect_MouseUp); //イベントハンドラデリゲート private void ButtonSelect_MouseUp(object sender, EventArgs e) { //イベント発生で処理する内容をここに記載 }
参照
ToolBarAnnotation メンバ | Newtone.ImageKit.Win.ToolBarAnnotation