svnno****@sourc*****
svnno****@sourc*****
2010年 12月 22日 (水) 10:11:35 JST
Revision: 1243 http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1243 Author: f_swallow Date: 2010-12-22 10:11:35 +0900 (Wed, 22 Dec 2010) Log Message: ----------- 選択したノードが展開できるときは選択したときに展開するようにした Modified Paths: -------------- trunk/Tween/AppendSettingDialog.vb -------------- next part -------------- Modified: trunk/Tween/AppendSettingDialog.vb =================================================================== --- trunk/Tween/AppendSettingDialog.vb 2010-12-22 00:04:51 UTC (rev 1242) +++ trunk/Tween/AppendSettingDialog.vb 2010-12-22 01:11:35 UTC (rev 1243) @@ -107,8 +107,15 @@ Private _MyUserstreamPeriod As Integer Private _ValidationError As Boolean = False + Private FirstExpandNode As Boolean = True + Private _curPanel As Panel = Nothing Private Sub TreeView1_BeforeSelect(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewCancelEventArgs) Handles TreeView1.BeforeSelect + If _curPanel IsNot Nothing Then + _curPanel.Enabled = False + _curPanel.Visible = False + _curPanel = Nothing + End If If Me.TreeView1.SelectedNode Is Nothing Then Exit Sub Dim pnl = DirectCast(Me.TreeView1.SelectedNode.Tag, Panel) If pnl Is Nothing Then Exit Sub @@ -118,6 +125,11 @@ Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect If e.Node Is Nothing Then Exit Sub + If FirstExpandNode Then + FirstExpandNode = False + Else + e.Node.Expand() + End If Dim pnl = DirectCast(e.Node.Tag, Panel) If pnl Is Nothing Then Exit Sub pnl.Enabled = True @@ -332,6 +344,7 @@ End Sub Private Sub Setting_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing + If TreeView1.SelectedNode IsNot Nothing Then _curPanel = CType(TreeView1.SelectedNode.Tag, Panel) If tw IsNot Nothing AndAlso tw.Username = "" AndAlso e.CloseReason = CloseReason.None Then If MessageBox.Show(My.Resources.Setting_FormClosing1, "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Cancel Then e.Cancel = True @@ -610,8 +623,15 @@ .SelectedNode = .Nodes(0) End With - + If _curPanel IsNot Nothing Then + _curPanel.Enabled = False + _curPanel.Visible = False + End If + _curPanel = BasedPanel + _curPanel.Enabled = True + _curPanel.Visible = True ActiveControl = Username + TreeView1.SelectedNode = Nothing End Sub Private Sub UserstreamPeriod_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles UserstreamPeriod.Validating