■56153 / ) |
Re[2]: ToolStripMenuItemをクリックで閉じない方法 |
□投稿者/ shu (337回)-(2010/12/30(Thu) 12:35:12)
|
■No56152 (オショウ さん) に返信
VBですがこんな感じでどうでしょう? アイテムクリックで閉じたらまた開く処理です。
Private m_blnOpen As Boolean = False
Private Sub ToolStripDropDownButton1_DropDownOpened(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripDropDownButton1.DropDownOpened m_blnOpen = False End Sub
Private Sub ToolStripDropDownButton1_DropDownItemClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ToolStripDropDownButton1.DropDownItemClicked m_blnOpen = True End Sub
Private Sub ToolStripDropDownButton1_DropDownClosed(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripDropDownButton1.DropDownClosed If m_blnOpen Then BackgroundWorker1.RunWorkerAsync() End If End Sub
Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted ToolStripDropDownButton1.ShowDropDown() End Sub
|
|