[Mono-list] WinForm TreeView Control

Stifu stifu at free.fr
Sun Jan 17 08:49:09 EST 2010


PS: looking more closely at your code, I don't know what "EhlMenu" is
supposed to be, but it doesn't change for each loop iteration. Ie: you're
attaching the event multiple times to the same object. So that could explain
your issue (and so it wouldn't be a Mono bug).


Stifu wrote:
> 
> I don't know whether what you described is a Mono bug or not (did you try
> with .NET? If so it's worth filing a bug with a test case), but you could
> try doing it this way instead: handle the DoubleClick event of the
> TreeView (not of the nodes), and in it, check which node is the selected
> or hovered node (if any).
> That way, you don't need to attach more than one event.
> 
> 
> Rıdvan Tülünay wrote:
>> 
>> Hi,
>> I am using, TreeView Control on my form,
>> I wrote doubleclickevent on it,
>> problem is on event occurs times,
>> in my TreeView element has four node, events occur for four times,
>> but I clicked only one node.
>> 
>> my code,
>> 
>> foreach (DataRow dRw in ehil_dataset.Tables["sismenu"].Rows)
>> {
>>                 TreeNode newNode = new TreeNode();
>>                 newNode.Text = dRw["UYGISMI"].ToString();
>>                 newNode.Tag = dRw["UYGKODU"].ToString();
>>                 EhlMenu.NodeMouseDoubleClick += new
>> TreeNodeMouseClickEventHandler(EhlMenu_NodeMouseDoubleClick);
>> }
>> 
>> _______________________________________________
>> Mono-list maillist  -  Mono-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-list
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/WinForm-TreeView-Control-tp27198772p27198936.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list