微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Wince下透明Label的实现(vb.net)

在WinCE下实现透明Label,搞了半天,终于在网上找到正解,还是很不容易的,现在把解决方案理一下。

步骤如下:

(0)建个空工程

(1)拖个PictureBox控件进来,名称为PictureBox1;

(2)拖个Label控件进来,名称为Label1;

(3)将Label控件放到PictureBox上面,并把Visable属性设置成False

(4)在Form1_Load事件里加入以下代码:

(5)加入以下变量定义和DrawLabel函数


(6) 创建pictureBox1_Paint函数,加入以下代码:


(7)运行一下吧,看看效果


<!-- /* Font DeFinitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:Simsun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:"/@宋体"; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} /* Style DeFinitions */ p.Msonormal,li.Msonormal,div.Msonormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; mso-pagination:none; font-size:10.5pt; mso-bidi-font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:宋体; mso-font-kerning:1.0pt;} /* Page DeFinitions */ @page {mso-page-border-surround-header:no; mso-page-border-surround-footer:no;} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} -->

原文地址:https://www.jb51.cc/vb/261824.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐