WinForm将表单最大化到任务栏的顶部 [英] WinForm maximize form to the top of taskbar

查看:75
本文介绍了WinForm将表单最大化到任务栏的顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在运行程序时将窗体状态设置为最大化。但是如何最大化直到屏幕底部?它应该在任务栏的顶部最大化。我的意思是如果我的屏幕分辨率是1024x768,表格不应该最大化到它的高度768,因为有任务栏。例如,它应该将高度最大化到758。怎么做?

Hi all,

I have set my form windows state to be maximize when I run the program. But how come it maximize until the bottom of the screen? It should be maximized on top of taskbar.. I mean if my screen resolution is 1024x768 the form should not maximize to its height of 768 because there is taskbar. It should maximize the height to 758 for example. How to do this?

推荐答案

this.MaximumSize = Screen.PrimaryScreen.WorkingArea.Size;



我不起诉,但试一试。 :)



-KR


I'm not sue, but give it a try. :)

-KR


尝试:

Try:
private void Form1_Load(object sender, EventArgs e)
        {
            this.Top = 0;
            this.Left = 0;


            this.Size = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height - 10);
        }


这篇关于WinForm将表单最大化到任务栏的顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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