Listview and Event on Compact .net fw
-
Hello, I'm trying to develop a simple Explorer, just to kill time, I've got a problem for what concern context menu and listview's item. I try to explain at my best. I tryied to use
this.listView1.ItemActivate += new System.EventHandler(this.item_Selected);
to catch ItemActivate event and here's the function's codeprivate void item_Selected(object sender, System.EventArgs e) { try { ListViewItem currentItem = this.listView1.FocusedItem; ---> currentItem.ListView.ContextMenu = itemMenu; FileInfo f = new FileInfo(currentItem.Text); //FileInfo f = new FileInfo(currentItem.Text); if(f.Attributes == System.IO.FileAttributes.Directory)
how do I reset the context to default one when no item are selected? and why I've difficulties to unselect the line I checked?? is a problem of itemactivate event?? Thanks Paolo