好吧,我是PointToScreen(),但当控件在组框内时,这种方法不起作用,给我错误的坐标.
那么还有另一种方法来获取组控件内控件的位置吗?
我需要屏幕位置,所以我可以在该控件附近显示一个对话框.
谢谢
Probably you are using PointToScreen on the wrong control...
If you have a groupbox with a button then the following code works just fine:
Point p = groupBox1.PointToScreen(button1.Location);
Run Code Online (Sandbox Code Playgroud)