Nevron Forum

Loading a skin

https://www.nevron.com/Forum/Topic2935.aspx

By JSW W. - Monday, January 25, 2010

Public m_Skin As New NSkin() 'Nevron skin

'Public NevronSkinResource As New NSkinResource()

NevronSkinResource.SkinName = "Vista"

If (m_Skin.Load(NevronSkinResource)) Then

NSkinManager.Instance.Skin = m_Skin

End If

I dropped NSkinResource() in designer view but ... this code never goes inside the If statement.

Could you suggest? the Fix?

By JSW W. - Monday, January 25, 2010

I played around and cheked copy to local in reference setting for

nevron.WinForm.Skins

So it works now. However, i did not want to ship dll as is with the project do you have alternative? I am new so please show steps. 

By JSW W. - Tuesday, January 26, 2010

With above I can load Vista, Orange etc. but can not load "Office 2007 Black"

It never pass the load() function.

By JSW W. - Tuesday, January 26, 2010

Never mind, I change name "Office2007Black" then it works.

Is there a way to see what available skin name in dll. The guessing is not healthy.

Anyway, still waiting on adding reference without shiping skin.dll with the project.

By Angel Chorbadzhiev - Tuesday, January 26, 2010

Hello JSW W.,

To load all available skins you can do the following:

Dim skins() As NSkin = NSkinManager.Instance.LoadResourceSkins(Assembly.Load("Nevron.UI.WinForm.Skins"))

 

You can apply skin to your application without reference the Nevron.UI.WinForm.Skins.dll.

To do that you have to open the skin designer and load the Nevron.UI.WinForm.Skins.dll.

Pick the desired skin from the list with available skins, and then save it as xml file.

Check this topic in our online documentation for more info.

Then you can load this skin in your application by the following way:

Dim resource As NSkinResource = New NSkinResource()

resource.ResourceType = SkinResourceType.File

resource.FilePath = filePath

resource.SkinName = skinName

Dim skin As NSkin = New NSkin()

If skin.Load(resource) Then

NSkinManager.Instance.Skin = skin

End If

This way you will only ship the xml file with the skin and not the assembly file.

Regards,

Angel.

 

By JSW W. - Friday, January 29, 2010

Thanks,