两种方法:
一:直接调用tab控件的底层控件设置背景图片
Dim TabCtl As C1.Win.C1Command.C1DockingTab = e.Form.Controls("TabControl1").BaseControl
TabCtl.TabPages(0).BackgroundImage = GetImage("背景2.jpg")
窗口的AfterLoad事件加上这两句代码之后设置好背景图片,然后用Label控件可以显示出来透明效果
此主题相关图片如下:1.jpg
二:用GDI+绘制背景图片与文本
Dim p As WinForm.Painter = e.Form.Controls("Painter1")
Dim g As Graphics = p.Graphics
g.DrawImage(getImage("背景1.jpg"),0,0,e.Form.BaseForm.Width,e.Form.BaseForm.Height)
'DrawString(ByVal s As String, ByVal font As System.Drawing.Font, ByVal brush As System.Drawing.Brush, ByVal x As Single, ByVal y As Single)
'画两次是为了做出阴影效果
g.DrawString("欢迎进入",New Font("宋体",16,FontStyle.Bold Or FontStyle.Italic),Brushes.Blue,330,200)
g.DrawString("欢迎进入",New Font("宋体",16,FontStyle.Bold Or FontStyle.Italic),Brushes.Blue,331,201)
g.DrawString("通用",New Font("黑体",26,FontStyle.Bold),Brushes.Blue,382,232)
g.DrawString("通用",New Font("黑体",26,FontStyle.Bold),Brushes.Blue,380,230)
g.DrawString("ERP",New Font("宋体",30,FontStyle.Bold Or FontStyle.Italic),Brushes.Red,452,227)
g.DrawString("ERP",New Font("宋体",30,FontStyle.Bold Or FontStyle.Italic),Brushes.Red,450,225)
g.DrawString("管理系统",New Font("黑体",26,FontStyle.Bold),Brushes.Blue,522,232)
g.DrawString("管理系统",New Font("黑体",26,FontStyle.Bold),Brushes.Blue,520,230)
p.Repaint()
也是窗口的AfterLoad事件
此主题相关图片如下:2.jpg
[此贴子已经被作者于2012-1-29 22:54:10编辑过]