各位网友好,在VB中,如何改变按钮的外观样式

 我来答
百度网友f134c02
2011-07-12 · TA获得超过726个赞
知道小有建树答主
回答量:1042
采纳率:0%
帮助的人:602万
展开全部
你说的是类似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
百度网友b8d7be837
2011-07-10 · TA获得超过819个赞
知道小有建树答主
回答量:865
采纳率:0%
帮助的人:849万
展开全部
设置style、picture、downpicture、disablepicture属性来改变按钮外观。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
factor_hg
2011-07-10 · TA获得超过1425个赞
知道小有建树答主
回答量:1444
采纳率:0%
帮助的人:407万
展开全部
你想好看就`自己做按钮
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
百度网友bdb9803
2011-07-10 · TA获得超过1.1万个赞
知道大有可为答主
回答量:1.1万
采纳率:53%
帮助的人:9890万
展开全部
搜索 imagebutton ,会找到你想要的结果
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 2条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式