1using System; 2using System.Collections.Generic; 3using System.ComponentModel; 4using System.Data; 5using System.Drawing; 6using System.Text; 7using System.Windows.Forms; 8 9namespace CCDTest 10{ 11 public partial class Form1 : Form 12 { 13 string filename; 14 Label lblResult; 15 public Form1() 16 { 17 InitializeComponent(); 18 filename = Application.StartupPath + "//cc1.bmp"; 19 lblResult = new Label(); 20 lblResult.Location = new Point(0,0); 21 lblResult.Parent = pbCCD; 22 lblResult.BackColor = Color.Transparent; 23 lblResult.Text = "你好!"; 24 lblResult.Visible = false; 25 } 26 27 private void Form1_Load(object sender, EventArgs e) 28 { 29 pbCCD.Load(filename); 30 } 31 32 private void pbCCD_MouseDown(object sender, MouseEventArgs e) 33 { 34 lblResult.Visible = true; 35 36 lblResult.Location = e.Location; 37 } 38 39 private void pbCCD_MouseUp(object sender, MouseEventArgs e) 40 { 41 lblResult.Visible = false; 42 } 43 } 44}
如何在PictureBox上透明的显示文字1(利用控件技术)
最新推荐文章于 2024-04-29 11:24:55 发布