透明的问题 [英] problem with transparent

查看:94
本文介绍了透明的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<</pre> i具有一个Pictrebox和2个PictureBox,它们在运行时创建,并将2张图像设置为它们各自的背景,并可以通过键移动,但是如果它们彼此相接,则打开消失了,即使我将颜色重新设置为透明
请帮助我

<pre></pre>i have a pictrebox and 2 pictureboxes that create in run time and set 2 image to back ground of each of them and can move with keys but if they bring to each other the under on disapear even i set back color to transparent
please help me

推荐答案

我不确定是否可以将图片框设置为透明.
面板之类的容器控件也可以.

您只需要覆盖CreateParams方法并在ExStyle上设置WS_EX_TRANSPARENT标志.

I''m not sure if a picturebox can be set to transparent.
Container controls like the Panel can be though.

You just need to override the CreateParams method and set the WS_EX_TRANSPARENT flag on ExStyle.

protected override CreateParams CreateParams
{
	get
	{
	        CreateParams cp = base.CreateParams;
		cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT

		return cp;

	}
}


这篇关于透明的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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