如何实现vb窗体换肤?除了ActiveSkin,
解决方案 »
- 送分100分: Conn.BeginTrans 的返回值的问题
- 请问哪儿有VB6.0的英文版下载??
- 关于COMBO的一个问题??
- 如何用VBA提取网上的表格数据进Excel
- 用VB6+ADO+SQL SERVER 2000 怎样来实现这样的功能 ?
- 如果用vb6.0 调用CAD2004按代码进行画图,然后将图保存为DWG文件?
- 谁能给个类似Windows扫雷游戏的思想啊?
- vb 中使用select 的问题
- 部分乱码,确实乱
- vb中有关htmlhelp workshop的问题。
- Text控件中的文本要如何分开:如,我在文本中显示的是06:00:00,我应如何做才能在文本击中文本框中的06,便选中06。如果点中00,选的是00
- 求救,關於TreeView的問題,它提未我 Invilad Object
我写过这方面的东东。
http://www.eaglestudio.net/Binkinst.rar
ReleaseCapture
SendMessage TheForm.hWnd, &HA1, 2, 0&
End SubPublic Sub MakeWindow(TheForm As Form)(设置图片)
'TheForm.BackColor = RGB(254, 255, 180)
TheForm.Caption = TheForm!Title.Caption
TheForm!Title.Left = 60
TheForm!Title.Top = 6
TheForm!Title.ForeColor = &HC0C000
TheForm!imgTitleLeft.Stretch = True
TheForm!imgTitleRight.Stretch = True
TheForm!imgTitleMain.Stretch = True
TheForm!imgWindowLeft.Stretch = True
TheForm!imgWindowBottomLeft.Stretch = True
TheForm!imgWindowBottom.Stretch = True
TheForm!imgWindowBottomRight.Stretch = True
TheForm!imgWindowRight.Stretch = True
With TheForm!imgTitleLeft
.Top = 0
.Left = 0
End With
With TheForm!imgTitleRight
.Top = 0
.Left = (TheForm.Width / Screen.TwipsPerPixelX) - TheForm!imgTitleRight.Width
End With
With TheForm!imgTitleMain
.Top = 0
.Left = TheForm!imgTitleLeft.Width
.Width = (TheForm.Width / Screen.TwipsPerPixelX) - TheForm!imgTitleRight.Width + TheForm!imgTitleLeft.Width
End With
With TheForm!imgWindowLeft
.Top = TheForm!imgTitleLeft.Height
.Left = 0
.Height = (TheForm.Height / Screen.TwipsPerPixelY) - TheForm!imgTitleLeft.Height + TheForm!imgTitleRight.Height
End With
With TheForm!imgWindowBottomLeft
.Top = (TheForm.Height / Screen.TwipsPerPixelY) - TheForm!imgWindowBottomLeft.Height
.Left = 0
End With
With TheForm!imgWindowBottom
.Top = (TheForm.Height / Screen.TwipsPerPixelY) - TheForm!imgWindowBottom.Height
.Left = TheForm!imgWindowBottomLeft.Left
.Width = (TheForm.Width / Screen.TwipsPerPixelX) - TheForm!imgWindowBottomLeft.Width + TheForm!imgWindowBottomRight.Width
End With
With TheForm!imgWindowBottomRight
.Top = (TheForm.Height / Screen.TwipsPerPixelY) - TheForm!imgWindowBottomRight.Height
.Left = (TheForm.Width / Screen.TwipsPerPixelX) - TheForm!imgWindowBottomRight.Width
End With
With TheForm!imgWindowRight
.Top = TheForm!imgTitleRight.Height
.Left = (TheForm.Width / Screen.TwipsPerPixelX) - TheForm!imgWindowRight.Width
.Height = (TheForm.Width / Screen.TwipsPerPixelX) - TheForm!imgTitleRight.Height + TheForm!imgWindowBottomRight.Height
End With
'DoTransparency TheForm
End Sub
Public Sub skinWindow(TheForm As Form) '更换样式
TheForm.Hide
Static i As String
i = Trim(Form4.Text1)
TheForm!imgTitleLeft.Stretch = False
TheForm!imgTitleRight.Stretch = False
TheForm!imgTitleMain.Stretch = False
TheForm!imgWindowLeft.Stretch = False
TheForm!imgWindowBottomLeft.Stretch = False
TheForm!imgWindowBottom.Stretch = False
TheForm!imgWindowBottomRight.Stretch = False
TheForm!imgWindowRight.Stretch = FalseTheForm!imgTitleLeft.Picture = LoadPicture(App.Path & "\skin\" & i & "\imgTitleleft.bmp")
TheForm!imgTitleRight.Picture = LoadPicture(App.Path & "\skin\" & i & "\imgTitleRight.bmp")
TheForm!imgTitleMain.Picture = LoadPicture(App.Path & "\skin\" & i & "\imgTitleMain.bmp")
TheForm!imgWindowLeft.Picture = LoadPicture(App.Path & "\skin\" & i & "\imgWindowLeft.bmp")
TheForm!imgWindowBottomLeft.Picture = LoadPicture(App.Path & "\skin\" & i & "\imgWindowBottomLeft.bmp")
TheForm!imgWindowBottom.Picture = LoadPicture(App.Path & "\skin\" & i & "\imgWindowBottom.bmp")
TheForm!imgWindowBottomRight.Picture = LoadPicture(App.Path & "\skin\" & i & "\imgWindowBottomRight.bmp")
TheForm!imgWindowRight.Picture = LoadPicture(App.Path & "\skin\" & i & "\imgWindowRight.bmp")
MakeWindow TheForm
Form4.Hide
End Sub'设置边为椭圆
'Public Sub DoTransparency(TheForm As Form)
'Dim TempRegions(6) As Long
'Dim FormWidthInPixels As Long
'Dim FormHeightInPixels As Long
'Dim a
'FormWidthInPixels = TheForm.Width / Screen.TwipsPerPixelX
'FormHeightInPixels = TheForm.Height / Screen.TwipsPerPixelY
' Make a rounded rectangle shaped region with the dimentions of the form
'a = CreateRoundRectRgn(0, 0, FormWidthInPixels, FormHeightInPixels, 24, 24)
' Set this region as the shape for "TheForm"
' a = SetWindowRgn(TheForm.hWnd, a, True)
'End Sub你事先得有一组图片(八部分)
上面是模块中编写的,拿去调用就行了,调用:skinWindow me
自己画图作皮肤(最好jpg教小),什么按钮之类的可见控件一起画上(还有窗口拖动条)
然后用它作form的背景,原拖动条去掉(改form的属性,然后在那个位置加个image控件,用api使其有拖动窗口的能力),最后把控件拖到适当的位置,ok.
尽管很笨,但非常完美,我试过不错。
楼上的,我看了你的作品,不错,怎么弄的?
我光是SKIN的代码都好几千行:)