Welcome Guest Search | Active Topics | Members | Log In | Register

Giving user a choice of skins Options
wjstarck
Posted: Thursday, July 22, 2010 3:29:38 PM
Rank: Newbie
Groups: Member

Joined: 7/22/2010
Posts: 6
Points: -129
It'd be nice if I could include several (many?) skins with my app and let the user choose which they'd want to apply.

It doesn't look like this is possible currently, but if it could be added, it'd be a nice addition to VisualStyler.
SkinSoft Support
Posted: Thursday, July 22, 2010 4:37:12 PM

Rank: Administration
Groups: Administration

Joined: 2/19/2008
Posts: 158
Points: -1,473
Location: UK
Hi,

Yes, you can already provide a choice of skins to the end user using the ShowStyleBrowserDialog function.
You just need to deploy one or more VSSF files into the same folder as your application and call this method.

The following sample code demonstrates how to implement this feature.

C# sample code
Code:

        private void btnChooseSkin_Click(object sender, EventArgs e)
        {
            // Show the built-in style browser dialog
            string selectedStyle;
            if ( visualStyler1.ShowStyleBrowserDialog("Select a skin", null, out selectedStyle) == DialogResult.OK )
            {
                // Load the selected style
                visualStyler1.LoadVisualStyle(selectedStyle);
            }
        }


VB.Net sample code
Code:

Private Sub btnChooseSkin_Click(ByVal sender As Object, ByVal e As EventArgs)
    ' Show the built-in style browser dialog
      Dim selectedStyle As String
      If visualStyler1.ShowStyleBrowserDialog("Select a skin", Nothing, selectedStyle) = DialogResult.OK Then
          ' Load the selected style
            visualStyler1.LoadVisualStyle(selectedStyle)
      End If
End Sub


You can also specify an existing folder path for the filePath argument, if it's null then the application folder is used.
When the user clicks on the button, the following dialog will display a preview of each style you've provided.
When the user selects a style and clicks OK, the style is loaded and applied to the current application UI.


wjstarck
Posted: Thursday, July 22, 2010 7:51:06 PM
Rank: Newbie
Groups: Member

Joined: 7/22/2010
Posts: 6
Points: -129
Excellent.

Thank you.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.6 (NET v2.0) - 11/14/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.041 seconds.