在底部位置的winform离开屏幕的角落 [英] Position winform in the bottom left corner of the screen

查看:173
本文介绍了在底部位置的winform离开屏幕的角落的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想放置在屏幕的左下角表格(在启动按钮)我有以下的code,试图做到这一点,但只考虑到了屏幕的工作区 - 这样的形式位于正上方的启动按钮:

I am trying to position a form in the bottom left hand corner of the screen (on the start button) I have the following code that attempts to do this, but only takes into account the work area of the screen - so the form is positioned just above the start button:

int x = Screen.PrimaryScreen.WorkingArea.Left + this.Width;
int y = Screen.PrimaryScreen.WorkingArea.Bottom - this.Height;
this.Location = new Point(x, y);

一个演示/屏幕下方是进一步证明什么,我试图做的:

A demo / screen is below to further demonstrate what I am trying to do:

推荐答案

使用 Screen.PrimaryScreen.Bounds 属性和设置 this.TopMost =真。这个作品:

Use Screen.PrimaryScreen.Bounds properties and set this.TopMost = true. this works:

int y = Screen.PrimaryScreen.Bounds.Bottom - this.Height;
this.Location = new Point(0, y);
this.TopMost = true;

这篇关于在底部位置的winform离开屏幕的角落的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆