MdiContainer属性将表单上的图形弄乱了 [英] MdiContainer property messes up graphics on form

查看:55
本文介绍了MdiContainer属性将表单上的图形弄乱了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我将isMdiContainer属性设置为true时,窗体上具有透明背景的图像就会显示为灰色.而且只要我在编辑器中,它就会将整个背景变成灰色.

Hi, whenever I set the isMdiContainer property to true the images I have on the form with a transparent background show up in grey. also whenever I'm in the editor, it turns the whole background to grey.

有什么办法可以阻止这种情况吗?谢谢!

Any idea how to stop this? Thanks!

推荐答案

不是真的.

Form.IsMdiContainer Property "Remarks This property changes the display and behavior of the form to an MDI parent form. When this property is set to true, the form displays a sunken client area with a raised border. All MDI child forms assigned to the parent form are displayed within its client area."

无论如何在此链接 Microsoft参考源.NET Framework 4.6.2-isMdiContainer 下面是属性isMdiContainer的代码,在C#的Form代码中,使用Telerik转换为VB.Net.

Anyhow at this link Microsoft Reference Source .NET Framework 4.6.2 - isMdiContainer the code for the property isMdiContainer, in the Form code in C#, converted to VB.Net using Telerik is below.

显然,如果设置了isMdiConainer,则AllowsTransparency = False,并将新的MdiClient添加到Forms控件中,我猜这是显示MdiClient Forms的地方.它说:因为当mdi为true时我们绘制背景,所以我们 需要"我认为这幅画所做的任何事情都可能会在凹陷的客户区域显示出凸起的边框.

Apparently if isMdiConainer is set then AllowsTransparency = False and a New MdiClient is added to the Forms controls which I guess is where MdiClient Forms get displayed or something. And it says "'since we paint the background when mdi is true, we need" whatever the painting does which I suppose displays a sunken client area with a raised border maybe.

以下代码也受版权保护.

Below code is copyrighted also.


''' <include file='doc\Form.uex' path='docs/doc[@for="Form.IsMdiContainer"]/*' />
''' <devdoc>
'''    <para>
'''       Gets or sets a value indicating whether the form is a container for multiple document interface
'''       (MDI) child forms.
'''    </para>
''' </devdoc>
<SRCategory(SR.CatWindowStyle), DefaultValue(False), SRDescription(SR.FormIsMDIContainerDescr)> _
Public Property IsMdiContainer() As Boolean
	Get
		Return ctlClient IsNot Nothing
	End Get

	Set
		If value = IsMdiContainer Then
			Return
		End If

		If value Then
			Debug.Assert(ctlClient Is Nothing, "why isn't ctlClient null")
			AllowTransparency = False
			Controls.Add(New MdiClient())
		Else
			Debug.Assert(ctlClient IsNot Nothing, "why is ctlClient null")
			ActiveMdiChildInternal = Nothing
			ctlClient.Dispose()
		End If
		'since we paint the background when mdi is true, we need
		'to invalidate here
		'
		Invalidate()
	End Set
End Property

'=======================================================
'Service provided by Telerik (www.telerik.com)
'Conversion powered by NRefactory.
'Twitter: @telerik
'Facebook: facebook.com/telerik
'=======================================================


这篇关于MdiContainer属性将表单上的图形弄乱了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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