vb如何使用she皮肤

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vb如何使用she皮肤相关的知识,希望对你有一定的参考价值。

参考技术A 调用控件,我喜欢skin#的皮肤控件用.

首先确认你拿到了这个控件:SkinH_VB6.dll

然后就是你拿到的皮肤了,比如你的皮肤名为:skin.she

调用方法是,先新建个模块:

Public Declare Function SkinH_Attach Lib "SkinH_VB6.dll" () As Long
Public Declare Function SkinH_AttachEx Lib "SkinH_VB6.dll" (ByVal lpSkinFile As String, ByVal lpPasswd As String) As Long
Public Declare Function SkinH_AttachExt Lib "SkinH_VB6.dll" (ByVal lpSkinFile As String, ByVal lpPasswd As String, ByVal nHue As Integer, ByVal nSat As Integer, ByVal nBri As Integer) As Long
Public Declare Function SkinH_AttachRes Lib "SkinH_VB6.dll" (lpRes As Any, ByVal nSize As Long, ByVal lpPasswd As String, ByVal nHue As Integer, ByVal nSat As Integer, ByVal nBri As Integer) As Long
Public Declare Function SkinH_AdjustHSV Lib "SkinH_VB6.dll" (ByVal nHue As Integer, ByVal nSat As Integer, ByVal nBri As Integer) As Long
Public Declare Function SkinH_Detach Lib "SkinH_VB6.dll" () As Long
Public Declare Function SkinH_DetachEx Lib "SkinH_VB6.dll" (ByVal hWnd As Long) As Long
Public Declare Function SkinH_SetAero Lib "SkinH_VB6.dll" (ByVal hWnd As Long) As Long
Public Declare Function SkinH_SetWindowAlpha Lib "SkinH_VB6.dll" (ByVal hWnd As Long, ByVal nAlpha As Integer) As Long
Public Declare Function SkinH_SetMenuAlpha Lib "SkinH_VB6.dll" (ByVal nAlpha As Integer) As Long
Public Declare Function SkinH_GetColor Lib "SkinH_VB6.dll" (ByVal hWnd As Long, ByVal nPosX As Integer, ByVal nPosY As Integer) As Long
Public Declare Function SkinH_Map Lib "SkinH_VB6.dll" (ByVal hWnd As Long, ByVal nType As Integer) As Long
Public Declare Function SkinH_LockUpdate Lib "SkinH_VB6.dll" (ByVal hWnd As Long, ByVal nLocked As Integer) As Long
Public Declare Function SkinH_SetBackColor Lib "SkinH_VB6.dll" (ByVal hWnd As Long, ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer) As Long
Public Declare Function SkinH_SetForeColor Lib "SkinH_VB6.dll" (ByVal hWnd As Long, ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer) As Long
Public Declare Function SkinH_SetWindowMovable Lib "SkinH_VB6.dll" (ByVal hWnd As Long, ByVal bMove As Integer) As Long
Public Declare Function SkinH_AdjustAero Lib "SkinH_VB6.dll" (ByVal nAlpha As Integer, ByVal nShwDark As Integer, ByVal nShwSharp As Integer, ByVal nShwSize As Integer, ByVal nX As Integer, ByVal nY As Integer, ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer) As Long
Public Declare Function SkinH_NineBlt Lib "SkinH_VB6.dll" (ByVal hDtDC As Long, ByVal left As Integer, ByVal top As Integer, ByVal right As Integer, ByVal bottom As Integer, ByVal nMRect As Integer) As Long
Public Declare Function SkinH_SetTitleMenuBar Lib "SkinH_VB6.dll" (ByVal hWnd As Long, ByVal bEnable As Integer, ByVal nMenuY As Integer, ByVal nTopOffs As Integer, ByVal nRightOffs As Integer) As Long
Public Declare Function SkinH_SetFont Lib "SkinH_VB6.dll" (ByVal hWnd As Long, ByVal hFont As Long) As Long
Public Declare Function SkinH_SetFontEx Lib "SkinH_VB6.dll" (ByVal hWnd As Long, ByVal szFace As String, ByVal nHeight As Integer, ByVal nWidth As Integer, ByVal nWeight As Integer, ByVal nItalic As Integer, ByVal nUnderline As Integer, ByVal nStrikeOut As Integer) As Long
Public Declare Function SkinH_VerifySign Lib "SkinH_VB6.dll" () As Long

然后再窗体的中加入代码:

SkinH_AttachEx app.path & "\skin.she", ""

如果开启特效的话在加一句:

Call SkinH_SetAero(1)

大概就这么多了.本回答被提问者和网友采纳
参考技术B 技术性的东东不懂,呵呵……凑凑热闹!

C# 使用SkinSharp皮肤库

SkinSharp 不同于其他任何换肤库,仅以标准的动态链接库形式存在,所以在使用时,无需进行系统注册。

文件说明:

SkinH_Net.dll SkinSharp换肤引擎, 标准的动态链接库

SkinH_CS.dll SkinSharp引用类库

skinh.she SkinSharp默认皮肤

 

现以最基本Attach()接口演示如何用一句代码进行换肤。其他接口可以参考官网的文档中心。

Attach()接口默认加载程序当前目录下的skinh.she文件进行换肤。

 

1. 创建C#.Net Windows应用程序

2. 拷贝软件包Bin目录中的SkinSharp相关文件 (SkinH_Net.dl SkinH_CS.dll skinh.she)到程序输出目录下

3. 添加接口类库SkinH_CS.dll的引用

ps:在解决方案那里找到引用=》右键=》添加引用=》选择SkinH_CS.dll

4. 为达到完美效果,需要将视觉样式选项去掉,在Program.cs 文件的Main函数中将启用视觉样式的代码注释

//Application.EnableVisualStyles();

5. 添加换肤代码

using SkinSharp;

namespace SkinSharp_Demo
{
    public partial class Form1 : Form
    {
        public SkinH_Net skin;
        public Form1()
        {
            skin = new SkinH_Net();
            skin.Attach();
            InitializeComponent();
        }

 

参数说明

Attach();//加载运行目录下的skinh.she

AttachEx("皮肤路径", "");//加载指定目录下的she皮肤

AttachRes(Properties.Resources.storm, Convert.ToUInt32(Properties.Resources.storm.Length), "", 0, 0, 0);//加载资源中的皮肤,其中的storm即为添加的资源文件,不需要添加she后缀

 

以上是关于vb如何使用she皮肤的主要内容,如果未能解决你的问题,请参考以下文章

在c#中,如何美化窗体的?

如何更换DevExpress控件皮肤

C# 使用SkinSharp皮肤库

[MFC美化] SkinSharp使用详解1-使用方法

求助一个神奇的问题,有关SkinH_VB6.dll跟鼠标滚轮API未知的问题,高分求助!

Flex 修改控件皮肤时,想给checkbox添加个背景图片,路径正确不知道为什么还报无法解析图片的问题