Click here to Skip to main content
16,015,444 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# wrapper for the WinPcap Library Pin
James T. Johnson13-Apr-02 0:20
James T. Johnson13-Apr-02 0:20 
GeneralRe: C# wrapper for the WinPcap Library Pin
Neil Van Note13-Apr-02 14:54
Neil Van Note13-Apr-02 14:54 
GeneralRe: C# wrapper for the WinPcap Library Pin
James T. Johnson13-Apr-02 15:09
James T. Johnson13-Apr-02 15:09 
GeneralRe: C# wrapper for the WinPcap Library Pin
Neil Van Note13-Apr-02 15:41
Neil Van Note13-Apr-02 15:41 
Generalsome problem about Font Pin
12-Apr-02 18:01
suss12-Apr-02 18:01 
QuestionA bug in TreeView AfterCheck event? Pin
gicio12-Apr-02 8:44
gicio12-Apr-02 8:44 
AnswerRe: A bug in TreeView AfterCheck event? Pin
Tom Welch12-Apr-02 8:51
Tom Welch12-Apr-02 8:51 
GeneralRe: A bug in TreeView AfterCheck event? Pin
gicio14-Apr-02 3:25
gicio14-Apr-02 3:25 
hi!
I have get a replay for me message on an other message board with the solution for this problem. and here is the replay message:

Re: A bug in TreeView AfterCheck event? Posted on: April 12 2002 12:10

Pawel,

By setting e.Node.Nodes[1].Checked = true;
you are firing a new event (because the checked was changed) and displaySaleContractTreeView_AfterCheck will be invoked again even before you come to the second line. I believe you are coming into an infinite loop here.

Anyhow, try to disable the AfterCheck event and enable it again at the end of your handler like this:

private void displaySaleContractTreeView_AfterCheck(object sender, System.Windows.Forms.TreeViewEventArgs e)
{

displaySaleContractTreeView.AfterCheck -= new System.Windows.Forms.AfterCheckEventHandler(this.displaySaleContractTreeView_AfterCheck);

e.Node.Nodes[1].Checked = true;
//..
//... do your stuff here
// ..

displaySaleContractTreeView.AfterCheck += new System.Windows.Forms.AfterCheckEventHandler(this.displaySaleContractTreeView_AfterCheck);

}

Hope this works,
Viel Spass,
Minh.

----------------------------------------------------

wow!!

thx!!


for every bug has enderminh a solution!!
IT´s WORK!!!!!!!!!!!!!!!

Wink | ;)

but some events that you used doesn´t exist.
this is the 100% correct code:



private void displaySaleContractTreeView_AfterCheck(object sender, System.Windows.Forms.TreeViewEventArgs e)
{

displaySaleContractTreeView.AfterCheck -= new System.Windows.Forms.TreeViewEventHandler(this.displaySaleContractTreeView_AfterCheck);

e.Node.Nodes[1].Checked = true;
e.Node.Nodes[2].Checked = true;
e.Node.Nodes[2].Nodes[0].Checked = true;
e.Node.Nodes[2].Nodes[1].Checked = true;
e.Node.Nodes[2].Nodes[2].Checked = true;
e.Node.Nodes[2].Nodes[3].Checked = true;
e.Node.Nodes[2].Nodes[4].Checked = true;
e.Node.Nodes[2].Nodes[5].Checked = true;
e.Node.Nodes[2].Nodes[6].Checked = true;
e.Node.Nodes[2].Nodes[7].Checked = true;
e.Node.Nodes[3].Checked = true;


displaySaleContractTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.displaySaleContractTreeView_AfterCheck);
}


thx again!!
DANKE!! Wink | ;)



Pawel
-------------------------------------------


Pawel,

No, it's not a bug. It supposed to happen. You have said that "ey, if anyone changes this checkbox, please let me know and run this method". But since you are changing the checkbox inside this own method, it will recursively call this method again. It is supposed to happen. You are still registered to this event. It's like putting the microphone in front of your speaker, I guess. Smile | :)

Minh.

-----------------------------------------------


Wink | ;)



Pawel



GeneralIcon from ImageList Pin
Derek Price12-Apr-02 2:19
Derek Price12-Apr-02 2:19 
GeneralRe: Icon from ImageList Pin
Rüpel18-Apr-02 2:52
Rüpel18-Apr-02 2:52 
GeneralRe: Icon from ImageList Pin
Derek Price18-Apr-02 4:40
Derek Price18-Apr-02 4:40 
QuestionHow to make a combobox uneditable? Pin
11-Apr-02 23:32
suss11-Apr-02 23:32 
AnswerRe: How to make a combobox uneditable? Pin
James T. Johnson11-Apr-02 23:35
James T. Johnson11-Apr-02 23:35 
GeneralUsing COM Objects (new interfaces) Pin
Anders Molin11-Apr-02 22:39
professionalAnders Molin11-Apr-02 22:39 
GeneralRe: Using COM Objects (new interfaces) Pin
James T. Johnson11-Apr-02 23:00
James T. Johnson11-Apr-02 23:00 
GeneralDamned Clipboard keeps changing format Pin
Nish Nishant11-Apr-02 22:01
sitebuilderNish Nishant11-Apr-02 22:01 
GeneralRe: Damned Clipboard keeps changing format Pin
James T. Johnson11-Apr-02 22:49
James T. Johnson11-Apr-02 22:49 
GeneralRe: Damned Clipboard keeps changing format Pin
Nish Nishant11-Apr-02 23:14
sitebuilderNish Nishant11-Apr-02 23:14 
GeneralDisplaying HTML Pin
paulb11-Apr-02 16:10
paulb11-Apr-02 16:10 
GeneralRe: Displaying HTML Pin
James T. Johnson11-Apr-02 22:33
James T. Johnson11-Apr-02 22:33 
GeneralRe: Displaying HTML Pin
Torsten Mauz12-Apr-02 1:57
Torsten Mauz12-Apr-02 1:57 
GeneralC# and Imaging Pin
Rohde11-Apr-02 6:16
Rohde11-Apr-02 6:16 
GeneralRe: C# and Imaging Pin
James T. Johnson11-Apr-02 8:13
James T. Johnson11-Apr-02 8:13 
GeneralRe: C# and Imaging Pin
Nick Parker12-Apr-02 6:52
protectorNick Parker12-Apr-02 6:52 
GeneralReading From a text file Pin
Gavin_Mannion11-Apr-02 5:23
Gavin_Mannion11-Apr-02 5:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.