Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Skin Framework
  New Posts New Posts RSS Feed - SkinFramework VB6 and .NET
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SkinFramework VB6 and .NET

 Post Reply Post Reply
Author
Message
Jean View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 December 2006
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jean Quote  Post ReplyReply Direct Link To This Post Topic: SkinFramework VB6 and .NET
    Posted: 31 May 2011 at 9:07am
Our application is written in VB6. TheSkinFramework works there perfect.
But now, we have .NET components, that we like to skin with the same style VB6 has.

I attached a small sample: uploads/2575/SkinTest.zip
Inside you'' find:
1.)  C# solution with a class library. Inside is a class and a WinForm.
2.)  VB6 project with the "MainForm". Here I start "SkinFramwork-Master".

This is the VB6-App: Everything looks fine, style is applied after button click.


Now on the second button click the .NET form appears:

The .Net form has the style too. Without setting SkinFile + SkinIniName in .NET!
Somehow the SkinFramework in .NET knows the settings from VB6.

But now, if I close the .NET form, the VB6-App looses it's style:

Cry

I could reset the skin on the VB6-Form, but that would cause flickering.
I'm shure I'm doing something wrong, but what? Confused
Product: Xtreme SuitePro (ActiveX) Version 15.0.2
Platform: Windows XP (32bit) German - SP 2
Language: VB6 / C# 4.0
Back to Top
Jean View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 December 2006
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jean Quote  Post ReplyReply Direct Link To This Post Posted: 19 July 2011 at 4:05am
This is the source code in the example:

VB6
Private Sub Command2_Click()
   'Load and apply skin
   SkinFramework1.ApplyWindow Me.hWnd
   SkinFramework1.ApplyOptions = xtpSkinApplyColors Or xtpSkinApplyFrame Or xtpSkinApplyMetrics Or xtpSkinApplyMenus
   SkinFramework1.LoadSkin App.Path & "\Vista.cjstyles", "NormalBlack.ini"
End Sub

Private Sub Command1_Click()
   'Show .NET-Form
   Dim s As Object
   Set s = CreateObject("SkinTest.SkinFramework")
   Call s.FormShow
End Sub

C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using AxXtremeSkinFramework;

namespace SkinTest
{
    public partial class SkinnedForm : Form
    {
        public AxSkinFramework _SkinFramework;

        public SkinnedForm()
        {
            _SkinFramework = new AxSkinFramework();
           
            ((System.ComponentModel.ISupportInitialize)(_SkinFramework)).BeginInit();
            this.Controls.Add(_SkinFramework);
            ((System.ComponentModel.ISupportInitialize)(_SkinFramework)).EndInit();
           
            InitializeComponent();
        }

        protected override void OnVisibleChanged(EventArgs e)
        {
            base.OnVisibleChanged(e);

            if (this.Visible)
            {
                _SkinFramework.ApplyWindow(this.Handle.ToInt32());
                this.BackColor = _SkinFramework.GetColor(XtremeSkinFramework.XTPColorManagerColor.STDCOLOR_BTNFACE);
            }
        }
    }
}


Why does vb6 loose the skin after closing the .NET Form?
Thanks for reading. Wink
Product: Xtreme SuitePro (ActiveX) Version 15.0.2
Platform: Windows XP (32bit) German - SP 2
Language: VB6 / C# 4.0
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 19 July 2011 at 7:40am
Problem that application should have single Skinframework in whole process. - you created 2 in Vb6 and in .NET.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Willowmaster View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 July 2010
Location: Netherlands
Status: Offline
Points: 180
Post Options Post Options   Thanks (0) Thanks(0)   Quote Willowmaster Quote  Post ReplyReply Direct Link To This Post Posted: 19 July 2011 at 8:52am
Maybe reapply the skin after closing event of the .net form?
 
Update: I didn't see your comment about the flickering.
 
Product: Xtreme SuitePro (ActiveX) version 15.3.1

Platform: Windows XP (32bit) - SP 3 (on VMWare)

Language: Visual Basic 6.0



Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.