c# MDI容器,与最大化的子窗体之间的3d边框效果,怎么去掉

.Net技术 码拜 9年前 (2016-02-23) 1268次浏览
c# MDI容器,与最大化的子窗体之间的3d边框效果,怎么去掉
参照 www.myexception.cn/c-sharp/1683098.html 的方法,用控件的Controls来包含,
但 这也会产生其他问题,
1。如窗体切换,按键ctrl+tab,
2。如主窗体的标题,(一般mdi是 主窗体text – [子窗体text])
3。最大化窗体,虽然都设置了dock,还是有尺寸不发生改变的问题
4。工具栏,菜单没办法合并的问题,,,
综上,能否还有别的办法?
例如重绘之类的
(重绘的不是很清楚能不能实现,本人只测了OnPaint,好像不行,进行重绘,在非mdi容器有效果的
,在mdi容器就不行,)
谢谢
解决方案

5

换一个方法

		[DllImport("user32.dll")]
		static extern long GetWindowLong(IntPtr hWnd, int nIndex);
		[DllImport("user32.dll")]
		static extern long SetWindowLong(IntPtr hWnd, int nIndex, long value);
		private void Form1_Load(object sender, EventArgs e)
		{
			foreach (Control c in this.Controls)
			{
				if (c is MdiClient)
				{
					IntPtr h = c.Handle;
					SetWindowLong(h, -16, GetWindowLong(h, -16) & ~0x00800000L);
					SetWindowLong(h, -20, GetWindowLong(h, -20) & ~0x00000200L);
					break;
				}
			}
		}

25

http://codego.net/366493/

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明c# MDI容器,与最大化的子窗体之间的3d边框效果,怎么去掉
喜欢 (0)
[1034331897@qq.com]
分享 (0)