日期:2014-05-18  浏览次数:20871 次

一段引发错误的代码,请大家看看.
C# code

Point ptClient = this.m_panel.Invoke(this.GetClientPos, new object[] {ptScreen});



报错:

Cannot implicitly convert type 'object' to 'System.Drawing.Point'. An explicit conversion exists (are you missing a cast?)

------解决方案--------------------
试试
Point ptClient = (Point)this.m_panel.Invoke(this.GetClientPos, new object[] {ptScreen});

------解决方案--------------------
强制类型转换!
------解决方案--------------------
类型转换就行了