易截截图软件、单文件、免安装、纯绿色、仅160KB

C#如何设置Forms背景颜色透明

C#实现Windows Form的透明背景用下面这段代码能实现非常有意思真正的透明背景,透明的地方不仅能显示其下一层的图案,而且能让鼠标穿越过去,成为真正的透明化。
注释掉的3行中,前2行代码是实现透明效果的另外第一个办法,最后1行是第三种办法。
但第一个方法根本不起作用,因为Windows Form所用“调色板”是“系统调色板”,即SystemColors,仅当SystemColors里面包含Transparent这个颜色才能显示出透明背景效果。
第三个设置Opacity的方法是将整个ClientWindow上的所有东西全部透明化,而不仅仅是背景,如果设置为0,则是完全透明,但整个程序该显示的部分也都透明了,意味着程序变得找不着了。
第二种办法可以实现透明化。
namespace DesktopClock
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
//SetStyle(ControlStyles.SupportsTransparentBackColor, true);
//this.BackColor=Color.Transparent;
this.BackColor = Color.White;
this.TransparencyKey = Color.White;
//this.Opacity = 0.5;
}
}
}

当开发一个透明软件的时候,比如QQ之类的,还需要设置一个窗体的属性this.FormBorderStyle=FormBorderStyle.None,意思是去掉标题栏


相关文档:

C# 通过xsl转换大xml文件方法

通过xsl转换大xml文件
这几天在做这个,网上的几个方法我都试过了,汇总如下
方法一:
XPathDocument myXPathDoc = new XPathDocument(tbXMLFile.Text);
 
XslCompiledTransform myXslTrans = new XslCompiledTransform();
myXslTrans.Load(tbXSLFile.Text);
 
XmlTextWriter myWriter = new XmlTextWrit ......

C#调用DLL (strmagic)

  大家在实际工作学习C#的时候,可能会问:为什么我们要为一些已经存在的功能(比如Windows中的一些功能,C++中已经编写好的一些方法)要重新编写代码,C#有没有方法可以直接都用这些原本已经存在的功能呢?答案是肯定的,大家可以通过C#中的DllImport直接调用这些功能。
  DllImport所在的名字空间 using System.Runt ......

ArcEngine 图例C#源码:

private void MakeLegend(IActiveView activeView,IPageLayout pageLayout)
      {
          //定义图例UID对象
          UID uid = new UIDClass();
      &n ......

C#自动关机源码

源码如下:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.IO;
using Microsoft.Win32;
namespace mv
{ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号