[Tween-svn] [1404] TreeViewの+-部分をクリックしたときに展開と折りたたみが行われなかったバグ修正

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 1月 25日 (火) 12:31:21 JST


Revision: 1404
          http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1404
Author:   syo68k
Date:     2011-01-25 12:31:20 +0900 (Tue, 25 Jan 2011)

Log Message:
-----------
TreeViewの+-部分をクリックしたときに展開と折りたたみが行われなかったバグ修正

Modified Paths:
--------------
    trunk/Tween/AppendSettingDialog.vb


-------------- next part --------------
Modified: trunk/Tween/AppendSettingDialog.vb
===================================================================
--- trunk/Tween/AppendSettingDialog.vb	2011-01-25 02:17:08 UTC (rev 1403)
+++ trunk/Tween/AppendSettingDialog.vb	2011-01-25 03:31:20 UTC (rev 1404)
@@ -141,11 +141,13 @@
 
     Private Sub ToggleNodeChange(ByVal node As TreeNode)
         If node Is Nothing Then Exit Sub
+        TreeViewSetting.BeginUpdate()
         If node.IsExpanded Then
             node.Collapse()
         Else
             node.Expand()
         End If
+        TreeViewSetting.EndUpdate()
     End Sub
 
     Private Sub TreeViewSetting_DrawNode(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawTreeNodeEventArgs) Handles TreeViewSetting.DrawNode
@@ -167,8 +169,10 @@
     End Sub
 
     Private Sub TreeViewSetting_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TreeViewSetting.MouseDown
-        Dim Node As TreeNode = TreeViewSetting.GetNodeAt(e.X, e.Y)
-        ToggleNodeChange(Node)
+        Dim info As TreeViewHitTestInfo = TreeViewSetting.HitTest(e.X, e.Y)
+        If CBool((info.Location And TreeViewHitTestLocations.Label)) Then
+            ToggleNodeChange(info.Node)
+        End If
     End Sub
 
     Private Sub Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save.Click



Tween-svn メーリングリストの案内
Back to archive index