winform 子窗体弹出在父窗体的相对位置,以适应不同的分辨率求大神解答

weixin_38067080 2019-08-06 01:54:05
...全文
84 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_38075729 2019-08-15
  • 打赏
  • 举报
回复
int ScreenHight = Screen.PrimaryScreen.Bounds.Height; int ScreenWidth = Screen.PrimaryScreen.Bounds.Width; int location_y = ScreenHight / 2; int location_x = (SysGlobalInfo.PicBox1_location_x +SysGlobalInfo.PicBox_width+ SysGlobalInfo.PicBox2_location_x-this.Width)/2; int X = Convert.ToInt32(location_x); int Y= Convert.ToInt32(location_y /1.35); this.Location = new Point(X, Y);
weixin_38129428 2019-08-07
  • 打赏
  • 举报
回复
好怪的需求。可以把子窗体嵌套在主窗体里。
weixin_38090265 2019-08-06
  • 打赏
  • 举报
回复
可以参考我的这篇笔记, 自定义弹出窗口所在的位置 https://www.cnblogs.com/aning2015/p/9268486.html
weixin_38081987 2019-08-06
  • 打赏
  • 举报
回复
获取主窗体相对屏幕的坐标,然后就可以做加减了
weixin_38078058 2019-08-06
  • 打赏
  • 举报
回复
定义窗体在屏幕的X,Y座标,这样不管分辨如何,它的位置始终不变

435

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧