two different cjstyles on same form (vb6) |
Post Reply |
Author | |
auto160
Newbie Joined: 26 February 2011 Location: ISRAEL Status: Offline Points: 8 |
Post Options
Thanks(0)
Posted: 26 February 2011 at 3:40pm |
i have two different cjstyles for two different PushButtons on the same form, when using the following code i get both buttons skinned the same no matter what, i try single SkinFramework control then two but no joy.. i obviously missing something
SkinFramework.LoadSkin App.Path & "\Green.cjstyles", "" SkinFramework.ApplyWindow btnGreen.hWnd SkinFramework2.LoadSkin App.Path & "\Blue.cjstyles", "" SkinFramework2.ApplyWindow BtnBlue.hWnd thank you much in advance! Cheers, A.
|
|
auto160
Newbie Joined: 26 February 2011 Location: ISRAEL Status: Offline Points: 8 |
Post Options
Thanks(0)
|
okay, still no joy but got some progress, my goal is to to have a few different skins for some buttons on my form, as a proof of concept i have made a cjstyles file with two schema's in it (Green & Blue):
the code is something like this (although i've tried many different syntax with no success): SkinFramework1.LoadSkin App.Path & "\Buttons.cjstyles", "Green.ini" SkinFramework1.ApplyWindow btnGreen.hWnd Set MyBlueSchema = SkinFramework1.CreateSchema(App.Path & "\Buttons.cjstyles", "Blue.ini") SkinFramework1.SetWindowTheme BtnBlue.hWnd, MyBlueSchema the results are that the two buttons are always skinned as per the LoadSkin command. i found a sample published by Oleg on how to use the CreateSchema so i know the code should work if the cjstyles was designed properly which, i guess, is not the case please please help me understand this. thank you all! BTW - is there any tutorial or help for the Skin Builder? |
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
Hi,
What you are trying to do is not possible! The code .ApplyWindow applies the Skin to the Form and all controls, not just a control. Therefore you can't have two different styles running concurrently! |
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
auto160
Newbie Joined: 26 February 2011 Location: ISRAEL Status: Offline Points: 8 |
Post Options
Thanks(0)
|
thx for your reply.
it can be done, here's a sample published by Oleg in an earlier post i found in my search for solution: uploads/6647/20090309_032441_Skins1.zip in that project there are three buttons using two different skins... said that, i now guess that the problem is in the way i implemented the cjstyles, by not define the NormalSize i have not kept the integrity of the cjstyles file... anyways, i'm keep on trying.. Best, A.
|
|
auto160
Newbie Joined: 26 February 2011 Location: ISRAEL Status: Offline Points: 8 |
Post Options
Thanks(0)
|
well.... still no joy i edit the cjstyles with NormalSize: still, cant manage to set one button as green and the other as blue.. i'm lost in space now.. any thoughts?? here's the skin project: uploads/6647/20090309_032441_Skins1.zip
|
|
auto160
Newbie Joined: 26 February 2011 Location: ISRAEL Status: Offline Points: 8 |
Post Options
Thanks(0)
|
this drives me nuts!!!! now i know for sure that the problem is with the cjstyles file, let me proof it for you all: this is the office2007.cjstyles file provided by codejock: uploads/6647/Office2007.rar using vb6 create a form with three buttons and using the following code you'll get 3 different skinned buttons: SkinFramework1.LoadSkin App.Path & "\Office2007.cjstyles", "" SkinFramework1.ApplyWindow Me.hWnd Set skinSchemaBlue = SkinFramework1.CreateSchema(App.Path & "\Office2007.cjstyles", "LightBlue.INI") SkinFramework1.SetWindowTheme Command1.hWnd, skinSchemaBlue Set skinSchemaAqua = SkinFramework1.CreateSchema(App.Path & "\Office2007.cjstyles", "NormalAqua.INI") SkinFramework1.SetWindowTheme Command2.hWnd, skinSchemaAqua Set skinSchemaSilver = SkinFramework1.CreateSchema(App.Path & "\Office2007.cjstyles", "NormalSilver.INI") SkinFramework1.SetWindowTheme Command3.hWnd, skinSchemaSilver so i'm quite sure that the problem is with the cjstyles file i build using the Skin Builder which has no help nor tutorial?! what gives??? anyways.. any help appreciated.. Best, A. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Attach your Buttons.skinproj and all images to check where you are.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
auto160
Newbie Joined: 26 February 2011 Location: ISRAEL Status: Offline Points: 8 |
Post Options
Thanks(0)
|
Hi Oleg,
Thank you for your reply, here's the project: uploads/6647/Buttons.rar looking forward to your help!! Best, A.
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
If you look at our skin MDI sample open it and add this to the frmDialogBar form for a different skin for each button on that form:
Private Sub Form_Load() Dim skinSchemaTemp As SkinSchema Set skinSchemaTemp = fMainForm.SkinFramework.CreateSchema(App.Path + "..\..\..\..\SkinFramework\Styles\Office2007.cjstyles", "NormalBlack.INI") fMainForm.SkinFramework.SetWindowTheme cmdColorDialog.hWnd, skinSchemaTemp Set skinSchemaTemp = fMainForm.SkinFramework.CreateSchema(App.Path + "..\..\..\..\SkinFramework\Styles\WinXP.Luna.cjstyles", "NormalBlue.INI") fMainForm.SkinFramework.SetWindowTheme cmdOpenDialog.hWnd, skinSchemaTemp Set skinSchemaTemp = fMainForm.SkinFramework.CreateSchema(App.Path + "..\..\..\..\SkinFramework\Styles\Office2007.cjstyles", "NormalSilver.INI") fMainForm.SkinFramework.SetWindowTheme cmdPrintDialog.hWnd, skinSchemaTemp Set skinSchemaTemp = fMainForm.SkinFramework.CreateSchema(App.Path + "..\..\..\..\SkinFramework\Styles\WinXP.Luna.cjstyles", "NormalHomestead.INI") fMainForm.SkinFramework.SetWindowTheme cmdFontDialog.hWnd, skinSchemaTemp End Sub And in main form: Private Sub MDIForm_Load() SkinFramework.LoadSkin App.Path + "..\..\..\..\SkinFramework\Styles\Office2007.cjstyles", "NormalBlue.ini" SkinFramework.ApplyWindow Me.hWnd ..... End Sub |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Also you only use 1 instance of skin framework like in the sample. For it to work you must apply a skin to the to the app like in the sample, only then will skinning individual objects work.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Actually you made all right. Only name of ini in your code should be "NormalBlue.ini" and "NormalGreen.ini"
so such code works for me Private Sub Form_Load() ' Main application skin SkinFramework1.LoadSkin App.Path & "\Codejock.cjstyles", "" SkinFramework1.ApplyWindow Me.hWnd Set MyBlueSchema = SkinFramework1.CreateSchema(App.Path & "\Buttons.cjstyles", "NormalBlue.ini") SkinFramework1.SetWindowTheme Command1.hWnd, MyBlueSchema Set MyBlueSchema = SkinFramework1.CreateSchema(App.Path & "\Buttons.cjstyles", "NormalGreen.ini") SkinFramework1.SetWindowTheme Command2.hWnd, MyBlueSchema End Sub |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
auto160
Newbie Joined: 26 February 2011 Location: ISRAEL Status: Offline Points: 8 |
Post Options
Thanks(0)
|
thx oleg!
Best, A.
|
|
2bit
Newbie Joined: 03 March 2013 Status: Offline Points: 4 |
Post Options
Thanks(0)
|
dear, my name is Marco. Using vb6 command button on the prj sample there is not problem.
Using Codejock pushbutton the SetWindowTheme does not apply the right schema and pushbutton keeps the global skin loaded with the loadskin method. What may be the problem?
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
try using XP or default theme for the push button, then apply skin
|
|
2bit
Newbie Joined: 03 March 2013 Status: Offline Points: 4 |
Post Options
Thanks(0)
|
it's not ok. the pushbutton receives from SkinFramework.loadSkin the global skin, but when I apply single SetWindowTheme... it ignores command.
this is the code: a sample with 48 windows command button and a pushbutton. I have modify Office2007 skin to have an added skin named "redskin.ini" Private Sub Form_Load() SkinFramework1.LoadSkin App.Path & "\Office20071.cjstyles", "LightBlue.INI" SkinFramework1.ApplyWindow Me.hWnd Dim i As Integer For i = 0 To 47 If i Mod 3 = 0 Then Set skinSchema(i) = SkinFramework1.CreateSchema(App.Path & "\Office20071.cjstyles", "LightBlue.INI") ElseIf i Mod 3 = 1 Then Set skinSchema(i) = SkinFramework1.CreateSchema(App.Path & "\Office20071.cjstyles", "NormalAqua.INI") ElseIf i Mod 3 = 2 Then Set skinSchema(i) = SkinFramework1.CreateSchema(App.Path & "\Office20071.cjstyles", "Redskin.ini") End If SkinFramework1.SetWindowTheme Command1(i).hWnd, skinSchema(i) Next Set skinSchema(48) = SkinFramework1.CreateSchema(App.Path & "\Office20071.cjstyles", "Redskin.INI") SkinFramework1.SetWindowTheme PushButton1.hWnd, skinSchema(48) PushButton1.Appearance = PushButton1.Appearance End Sub |
|
2bit
Newbie Joined: 03 March 2013 Status: Offline Points: 4 |
Post Options
Thanks(0)
|
have you got any idea about this problem?
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Sorry, it after going through the code it appears this isn't possible with the push buttons. You would need to use regular command buttons to do this.
|
|
2bit
Newbie Joined: 03 March 2013 Status: Offline Points: 4 |
Post Options
Thanks(0)
|
there is a way to pay a customization?
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions 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 |