Print Page | Close Window

SkinFramework VB6 and .NET

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=18476
Printed Date: 20 September 2024 at 11:23pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SkinFramework VB6 and .NET
Posted By: Jean
Subject: SkinFramework VB6 and .NET
Date 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 - 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



Replies:
Posted By: Jean
Date 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


Posted By: Oleg
Date 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


Posted By: Willowmaster
Date 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






Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net