treeview afterselect problem
-
Dear all, I have two treeviews on my form , and the afterselect method on both of them is like this :
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { tabControl1.Visible = false; } private void treeView2_AfterSelect(object sender, TreeViewEventArgs e) { tabControl1.Visible = true; }
The problem that I have, is that the tabcontrol that I would like to hide or show, only hides or shows once. After that, nothing happens anymore if I click on either treeviews. I tried attaching a messagebox to the methodes for debug reasons, but they don't show either. It looks like the afterselect method is not being called the second or third time I click on it. Can anyone help me out please ? kind regards, Rick -
Dear all, I have two treeviews on my form , and the afterselect method on both of them is like this :
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { tabControl1.Visible = false; } private void treeView2_AfterSelect(object sender, TreeViewEventArgs e) { tabControl1.Visible = true; }
The problem that I have, is that the tabcontrol that I would like to hide or show, only hides or shows once. After that, nothing happens anymore if I click on either treeviews. I tried attaching a messagebox to the methodes for debug reasons, but they don't show either. It looks like the afterselect method is not being called the second or third time I click on it. Can anyone help me out please ? kind regards, RickThe
AfterSelect
event fires after you select a specific node on the treeview, not the treeview itself. Once this has been selected, it will not fire again untill you select another node on the same tree. Sounds like what you want is to simply perform an action when a treeview is clicked, so you might as well use theClick
event. Hope this helps.Standards are great! Everybody should have one!
-
The
AfterSelect
event fires after you select a specific node on the treeview, not the treeview itself. Once this has been selected, it will not fire again untill you select another node on the same tree. Sounds like what you want is to simply perform an action when a treeview is clicked, so you might as well use theClick
event. Hope this helps.Standards are great! Everybody should have one!
Hi, Please try the following code snippet: BEGIN CODE private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { this.tabControl1.Visible = false; } private void treeView2_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { this.tabControl1.Visible = true; } END CODE I hope this helps :).
Regards, John Adams ComponentOne LLC
-
Hi, Please try the following code snippet: BEGIN CODE private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { this.tabControl1.Visible = false; } private void treeView2_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { this.tabControl1.Visible = true; } END CODE I hope this helps :).
Regards, John Adams ComponentOne LLC
-
Thanks, but I don't need any help, you might want to reply to the original poster ;).
Standards are great! Everybody should have one!
:laugh: i think he was in hurry
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y -------------------------------------------------------- 128 bit encrypted signature, crack if you can