winform 窗体最大化
来源:互联网 发布:房产拍卖淘宝司法拍卖 编辑:程序博客网 时间:2024/04/30 09:44
1:窗体首次加载时最大化
(1):主窗体
this.WindowState = FormWindowState.Maximized;
//窗体显示中间部分,不显示窗体名称和最小化、最大化、关闭按钮
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;
(2):子窗体
设置父窗体的属性:IsMdiContainer=True
Form f = new Form();
f.MdiParent = this;
f.WindowState = FormWindowState.Maximized;
[转]窗体最大化的时候,如何指定窗体的位置、大小(C#)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class FormRegion : Form.
{
private const long WM_GETMINMAXINFO = 0x24;
public struct POINTAPI
{
public int x;
public int y;
}
public struct MINMAXINFO
{
public POINTAPI ptReserved;
public POINTAPI ptMaxSize;
public POINTAPI ptMaxPosition;
public POINTAPI ptMinTrackSize;
public POINTAPI ptMaxTrackSize;
}
public FormRegion()
{
InitializeComponent();
this.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
}
protected override void WndProc(ref System.Windows.Forms.Message m)
{
base.WndProc(ref m);
if (m.Msg == WM_GETMINMAXINFO)
{
MINMAXINFO mmi = (MINMAXINFO)m.GetLParam(typeof(MINMAXINFO));
mmi.ptMinTrackSize.x = this.MinimumSize.Width;
mmi.ptMinTrackSize.y = this.MinimumSize.Height;
if (this.MaximumSize.Width != 0 || this.MaximumSize.Height != 0)
{
mmi.ptMaxTrackSize.x = this.MaximumSize.Width;
mmi.ptMaxTrackSize.y = this.MaximumSize.Height;
}
mmi.ptMaxPosition.x = 1;
mmi.ptMaxPosition.y = 1;
System.Runtime.InteropServices.Marshal.StructureToPtr(mmi, m.LParam, true);
}
}
}
}
MessageBox.Show("当前窗体标题栏高度"+(this.Height - this.ClientRectangle.Height).ToString());//获得当前窗体标题栏高度
ClientRectangle//
MessageBox.Show(SystemInformation.PrimaryMonitorSize.ToString()); //
//
MessageBox.Show("
MessageBox.Show("
MenuHeight//
CaptionHeight//
当前的屏幕除任务栏外的工作域大小
this.Width = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width;
this.Height = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;
当前的屏幕包括任务栏的工作域大小
this.Width=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
this.Height=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
任务栏大小
this.Width=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width-System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width;
this.Height=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height-System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;
winform实现全屏显示
WinForm:
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.TopMost = true;
- winform 窗体最大化
- 关于c# winForm窗体最大化的设置
- 关于c# winForm窗体最大化的设置
- 关于c# winForm窗体最大化的设置
- 关于winForm窗体最大化的设置(转)
- 关于winForm窗体最大化时全屏及遮盖任务栏问题
- winform窗体的最大化最小化按钮不显示
- C#WinForm窗体的最大化最小化及还原
- C#WinForm窗体的最大化最小化及还原
- WinForm(C#)中MDI子窗体最大化的问题
- VS2005中MDI子窗体怎么让他打开的时候最大化?默认最大化!winform
- winform中窗体最大化时 如何使窗体中内容也相应的全屏
- C# WinForm 关于窗体最大化时的是否全屏效果与是否遮盖任务
- C# Winform 捕获窗体的最小化和最大化事件、关闭按钮事件
- C# WinForm 关于窗体最大化时的是否全屏效果与是否遮盖任务栏
- c# winform 禁止窗体的一些操作(如最大化、最小化)
- C# Winform 捕获窗体的最小化和最大化事件、关闭按钮事件 .
- C# Winform 捕获窗体的最小化和最大化事件、关闭按钮事件
- AXI4
- Pro Android学习笔记(一零五):Alarm Manager(3):request code
- poj1258Agri-Net
- NYOJ 905 卡片游戏
- C#字符串与unicode互相转换
- winform 窗体最大化
- Where is the Marble?
- 关于iOS App Programming
- UVA 1069
- 开发商发行游戏前应注意的五大问题
- Android 之 内存管理
- 使用SSH+VNC实现安全的Linux远程桌面管理
- C#如何判断一个字符串是16进制字符串
- E. Cubes codeforce 180/E