Post by bobowk on Mar 3, 2017 7:10:09 GMT 10
Hey guys, How would I remove an item on a toolstrip at mouse pointer? I've tried linkBar.Items.RemoveAt(MousePosition.X, MousePosition.Y);
This is for my bookmarks bar Thanks!
|
|
Post by Imformas on Mar 3, 2017 22:31:15 GMT 10
Try using the MouseMove Event on the toolstrip. private void linkBar_MouseMove(object sender, MouseEventArgs e) { linkBar.Items.RemoveAt(MousePosition.X, MousePosition.Y); }
Programming language'sCSharpC++CObjective-CVBProject'sSharpMediaSharpEditYoutifygithub.com/Stephen-Fox-0
|
|
Post by Imformas on Mar 4, 2017 22:19:10 GMT 10
If you're using a contextMenuStrip witch i presume you are for clicking delete, just use the Tag reference on the contextMenuStrip, and place it as the toolstripItem and delete it like ToolstripItem item = (ToolStripItem)ContextMenuStrip.Tag; linkBar.Items.Remove(item);
once it removes, replace the old tag, with the last item on the tool strip like this ContextMenuStrip.Tag = listBar.items[listBar.Items.Count -1];
Programming language'sCSharpC++CObjective-CVBProject'sSharpMediaSharpEditYoutifygithub.com/Stephen-Fox-0
Last Edit: Mar 4, 2017 22:19:26 GMT 10 by Imformas
|
|