各位网友好,在VB中,如何改变按钮的外观样式
4个回答
展开全部
你说的是类似XP样式那些吗?
你试试看,在Form_Initialize()里写上(注意:只有编译成Exe后才能看到效果)
EnableXPStyle
'下面的用一个模块装上
Option Explicit
Private Type ACTCTX
cbSize As Long
dwFlags As Long
lpSource As String
wProcessorArchitecture As Integer
wLangId As Integer
lpAssemblyDirectory As String
lpResourceName As String
lpApplicationName As String
hModule As Long
End Type
Private Declare Function GetWindowsDirectoryW Lib "kernel32.dll" (ByVal lpBuffer As Long, ByVal uSize As Long) As Long
Private Declare Function CreateActCtxW Lib "kernel32.dll" (ByVal pActCtx As Long) As Long
Private Declare Function ActivateActCtx Lib "kernel32.dll" (ByVal hActCtx As Long, ByRef lpCookie As Long) As Long
Dim IDEMode As Boolean
Private Function SetIDE() As Boolean
IDEMode = True
SetIDE = True
End Function
Public Function EnableXPStyle() As Boolean
Dim Length As Long, Path As String, Ctx As ACTCTX, hActCtx As Long, Cookie As Long
Debug.Assert SetIDE
If IDEMode = False Then
Length = GetWindowsDirectoryW(0, 0)
If Length <> 0 Then
Path = Space(Length - 1)
If GetWindowsDirectoryW(StrPtr(Path), Length) <> 0 Then
Ctx.cbSize = Len(Ctx)
Ctx.lpSource = Path & "\WindowsShell.manifest"
hActCtx = CreateActCtxW(VarPtr(Ctx))
If hActCtx <> -1 Then
If ActivateActCtx(hActCtx, Cookie) <> 0 Then
EnableXPStyle = True
End If
End If
End If
End If
End If
End Function
你试试看,在Form_Initialize()里写上(注意:只有编译成Exe后才能看到效果)
EnableXPStyle
'下面的用一个模块装上
Option Explicit
Private Type ACTCTX
cbSize As Long
dwFlags As Long
lpSource As String
wProcessorArchitecture As Integer
wLangId As Integer
lpAssemblyDirectory As String
lpResourceName As String
lpApplicationName As String
hModule As Long
End Type
Private Declare Function GetWindowsDirectoryW Lib "kernel32.dll" (ByVal lpBuffer As Long, ByVal uSize As Long) As Long
Private Declare Function CreateActCtxW Lib "kernel32.dll" (ByVal pActCtx As Long) As Long
Private Declare Function ActivateActCtx Lib "kernel32.dll" (ByVal hActCtx As Long, ByRef lpCookie As Long) As Long
Dim IDEMode As Boolean
Private Function SetIDE() As Boolean
IDEMode = True
SetIDE = True
End Function
Public Function EnableXPStyle() As Boolean
Dim Length As Long, Path As String, Ctx As ACTCTX, hActCtx As Long, Cookie As Long
Debug.Assert SetIDE
If IDEMode = False Then
Length = GetWindowsDirectoryW(0, 0)
If Length <> 0 Then
Path = Space(Length - 1)
If GetWindowsDirectoryW(StrPtr(Path), Length) <> 0 Then
Ctx.cbSize = Len(Ctx)
Ctx.lpSource = Path & "\WindowsShell.manifest"
hActCtx = CreateActCtxW(VarPtr(Ctx))
If hActCtx <> -1 Then
If ActivateActCtx(hActCtx, Cookie) <> 0 Then
EnableXPStyle = True
End If
End If
End If
End If
End If
End Function
展开全部
设置style、picture、downpicture、disablepicture属性来改变按钮外观。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你想好看就`自己做按钮
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
搜索 imagebutton ,会找到你想要的结果
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询