VooDooBamboo
asked on
Problem with converting from ToolStripMenuItem to Button in C#
I am VERY new to C# coming from VB and having an issue. I have some code that had some options within a toolstipmenu. I removed these and replaced them with buttons on the form instead. Below is the code for one of them. I just took the code and copied it for the button but its not working.
It dies on....
ToolStripMenuItem item = (ToolStripMenuItem)sender;
Says...
Unable to cast object of type 'System.Windows.Forms.Butt on' to type 'System.Windows.Forms.Tool StripMenuI tem'.
I know its because there is no more toolstripmenu. As I said I replaced the options on that with buttons. Any ideas on what is wrong?
Thank you
It dies on....
ToolStripMenuItem item = (ToolStripMenuItem)sender;
Says...
Unable to cast object of type 'System.Windows.Forms.Butt
I know its because there is no more toolstripmenu. As I said I replaced the options on that with buttons. Any ideas on what is wrong?
Thank you
private void button14_Click(object sender, EventArgs e)
{
CurrentSeat.Enabled = true;
ToolStripMenuItem item = (ToolStripMenuItem)sender;
LastSeat = (KeyValuePair<LLUUID, LLVector3>)item.Tag;
Client.Self.RequestSit(LastSeat.Key, LastSeat.Value);
Client.Self.Sit();
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.