Hide a Treeview

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alistair George

    #1

    Hide a Treeview

    Hi.
    This is very odd see the code below, it runs through it UNTIL the
    condition is set, and what happens then is the treeview (tvNodes) is no
    longer active, but is visible. Never once is the Visible property set
    false. Any takers?


    private void tvNodes_KeyDown (object sender,
    System.Windows. Forms.KeyEventA rgs e)
    {
    tvNodes.Visible =!(tabControl1. SelectedIndex == 2);
  • Alistair George

    #2
    Re: Hide a Treeview

    Alistair George wrote:
    Hi.
    This is very odd see the code below, it runs through it UNTIL the
    condition is set, and what happens then is the treeview (tvNodes) is no
    longer active, but is visible. Never once is the Visible property set
    false. Any takers?
    >
    >
    private void tvNodes_KeyDown (object sender,
    System.Windows. Forms.KeyEventA rgs e)
    {
    tvNodes.Visible =!(tabControl1. SelectedIndex == 2);
    Changed the event fixed the issue as below:
    private void tabControl1_Sel ectedIndexChang ed(object sender,
    EventArgs e)
    {
    tvNodes.Visible = !(tabControl1.S electedIndex == 2);
    }

    Comment

    Working...