Print Page | Close Window

Form_Resize and Vista

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=8705
Printed Date: 14 May 2024 at 2:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Form_Resize and Vista
Posted By: Bako
Subject: Form_Resize and Vista
Date Posted: 07 November 2007 at 9:06am
Hi,

If SkinFramework is Enabled then

        Private Sub Form_Resize()
             If Me.Width < MIN_WIDTH Then
                   Me.Width = MIN_WIDTH <--- there is runtime error throwed
             End If
        End Sub      

Error occurs only under Vista and enabled SkinFramework.  If SkinFramework is disabled then error is not throwed.



Replies:
Posted By: Oleg
Date Posted: 08 November 2007 at 1:15am
Hello,
 
Please attach full project to test. 


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Bako
Date Posted: 08 November 2007 at 4:57am
Hi,

simple example, try exe file on Vista.

uploads/20071108_045637_CodeJock_Sample.zip - uploads/20071108_045637_CodeJock_Sample.zip


Posted By: gaudetm
Date Posted: 08 November 2007 at 6:44am
I try your code but avast anti-virus found a virus Win32:VB-ABJ [Trj] so be careful, your are probably infected by a virus
 
Marc


Posted By: Oleg
Date Posted: 08 November 2007 at 7:56am
Him
 
don't put SkinFramework1.ApplyOptions  and SkinFramework1.ApplyWindow to Activate event Move them to Load


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Bako
Date Posted: 09 November 2007 at 9:18am
Hi,

the problem is elsewhere, not in activate. Try second enclosed sample project.

Try first resize, maximize, minimize window without skin.
After click to button for activate skin and try maximize, minimize and maximize again.

uploads/20071109_091735_Vista_Resize_Pr.zip - uploads/20071109_091735_Vista_Resize_Pr.zip

Tomas


Posted By: Bako
Date Posted: 28 November 2007 at 6:32am
Does anybody fix this problem?


Posted By: ijwelch
Date Posted: 28 November 2007 at 10:19pm
The problem is that you're trying to set width when form is maximized. Add this line to beginning of Form_Resize event:

  If Me.WindowState = vbMaximized Then Exit Sub



Posted By: Bako
Date Posted: 29 November 2007 at 1:13am
Thanks, but this not solve the problem. See attached example in previous post.

When Form.WindowsState = vbMaximized then MIN_WIDTH and MIN_HEIGHT are not set. 

Tomas Bako
developer


Posted By: ijwelch
Date Posted: 29 November 2007 at 2:33am
No, the example you posted only checked for WindowState=vbMinimized.



Posted By: Bako
Date Posted: 29 November 2007 at 2:48am
OK. From other side.

Why line If Me.Width < MIN_WIDTH Then throws error under Vista and under Windows XP not? Problem is in reading value from Me.Width. Not in setting new values. When we remove skin under Vista, everything is ok.


Posted By: Bako
Date Posted: 29 November 2007 at 3:02am
Sorry, the description in first post in this topic was incorrect. This one is correct:

Private Sub Form_Resize()
             If Me.Width < MIN_WIDTH Then <--- there is runtime error throwed
                   Me.Width = MIN_WIDTH
             End If
        End Sub      


Posted By: ijwelch
Date Posted: 29 November 2007 at 5:01am
I see.

I've run it on Vista (32bit) and no error thrown so can't be much help here.

The only thing I would change is declare your constants as Single and try again (that way you're comparing like for like and eliminating some type casting quirk).


Posted By: Bako
Date Posted: 29 November 2007 at 7:00am
I find out following:

1. Run attached example and don't apply skin.
2. maximize form and than minimize (aktual width is 2400)
3. maximize form again and in FORM_RESIZE check width (aktual width is    
    19320), no errors occured. That's ok.

And try it again :

1. Run attached example and apply skin.
2. maximize form and than minimize (aktual width is 2400)
3. maximize form again and in FORM_RESIZE check width (aktual width is    
    2400!!!), no errors occured. That's no good, because WIDTH < MIN_WIDTH.

I could remove MIN_WIDTH setting, but size of other controls on this form is depend on this value (tab grids for example is resized incorrect).

This problem is only with combination of Vista and SkinFramework.





Posted By: Bako
Date Posted: 29 November 2007 at 7:03am
In second sequence is error, of course.



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