用 this.Opacity = 0.4; 让form 半透明
可是上面的控件 button picturebox 也都半透明了
如何让这些控件不透明?
可是上面的控件 button picturebox 也都半透明了
如何让这些控件不透明?
解决方案 »
- DateGridView消失及不是有效标识列
- C# 用什么文本控制对文字进行编号
- 配置文件中,sectionGroup到底有什么用?
- 如何使用HtmlElement中的GetAttribute得到style属性中的内容?
- 求一个正则
- sql语句如何实现替换多个特定字符串
- 如何用datagridview实现数据库的添加,删除,修改
- 如何在VC中调用.NET组件?
- 关于前台定时刷新数据的问题!~~
- new Socket 抛出SocketException异常 谢谢指导
- 在winform中,如何在子窗口重新加载父窗口的一个事件
- 请问一下时候在.net2005里面把CheckForIllegalCrossThreadCall置为False会有什么影响吗?比如内存错误或者Win32exception?
非要实现这样的效果的话,只有写一个Form模拟Button的操作了。
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;namespace WindowsApplication10
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Panel panel1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null; public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent(); //
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
} /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
} #region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// button1
//
this.button1.BackColor = System.Drawing.SystemColors.Control;
this.button1.Location = new System.Drawing.Point(72, 80);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "button1";
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.White;
this.panel1.Controls.Add(this.button1);
this.panel1.Location = new System.Drawing.Point(32, 48);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(232, 176);
this.panel1.TabIndex = 1;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.SystemColors.Control;
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.panel1);
this.Name = "Form1";
this.Text = "Form1";
this.TransparencyKey = System.Drawing.Color.White;
this.panel1.ResumeLayout(false);
this.ResumeLayout(false); }
#endregion /// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
}
你给的是镂空效果,我的意思是要求在一个“半透明”的容器中,显示button控件(不透明),该如何办呢?