TreeView本身不支持透明背景,重写WndProc以支持背景图片。using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; using System.ComponentModel; using System.Runtime.InteropServices; namespace MyControl { /// <summary> /// Displays a hierarchical collection of labeled items, each represented by a System.Windows.Forms.TreeNode. /// </summary> [ //Use the same attibutes as TreeView DesignerAttribute("System.Windows.Forms.Design.TreeViewDe...
winform中TreeView透明背景

winform中TreeView透明背景

我们在做winform应用的时候,大部分情况下都会碰到使用多线程控制界面上控件信息的问题。然而我们并不能用传统方法来做这个问题,下面我将详细的介绍。首先来看传统方法:public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Thread thread = new Thread(ThreadFuntion); thread.IsBackground = true; thread.Start(); } private void ThreadFuntion() { while (true) { this.textBox1.Text = DateTime.Now.ToString(); Thr...
c#中如何跨线程调用windows窗体控件

c#中如何跨线程调用windows窗体控件