Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Skin Framework
  New Posts New Posts RSS Feed - Form_Resize and Vista
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Form_Resize and Vista

 Post Reply Post Reply
Author
Message
Bako View Drop Down
Newbie
Newbie


Joined: 05 April 2007
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bako Quote  Post ReplyReply Direct Link To This Post Topic: Form_Resize and Vista
    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.
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: 08 November 2007 at 1:15am
Hello,
 
Please attach full project to test. 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Bako View Drop Down
Newbie
Newbie


Joined: 05 April 2007
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bako Quote  Post ReplyReply Direct Link To This Post Posted: 08 November 2007 at 4:57am
Hi,

simple example, try exe file on Vista.

uploads/20071108_045637_CodeJock_Sample.zip
Back to Top
gaudetm View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 September 2006
Location: Canada
Status: Offline
Points: 134
Post Options Post Options   Thanks (0) Thanks(0)   Quote gaudetm Quote  Post ReplyReply Direct Link To This Post 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
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: 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
Back to Top
Bako View Drop Down
Newbie
Newbie


Joined: 05 April 2007
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bako Quote  Post ReplyReply Direct Link To This Post 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

Tomas
Back to Top
Bako View Drop Down
Newbie
Newbie


Joined: 05 April 2007
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bako Quote  Post ReplyReply Direct Link To This Post Posted: 28 November 2007 at 6:32am
Does anybody fix this problem?
Back to Top
ijwelch View Drop Down
Senior Member
Senior Member


Joined: 20 June 2006
Status: Offline
Points: 262
Post Options Post Options   Thanks (0) Thanks(0)   Quote ijwelch Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Bako View Drop Down
Newbie
Newbie


Joined: 05 April 2007
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bako Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ijwelch View Drop Down
Senior Member
Senior Member


Joined: 20 June 2006
Status: Offline
Points: 262
Post Options Post Options   Thanks (0) Thanks(0)   Quote ijwelch Quote  Post ReplyReply Direct Link To This Post Posted: 29 November 2007 at 2:33am
No, the example you posted only checked for WindowState=vbMinimized.

Back to Top
Bako View Drop Down
Newbie
Newbie


Joined: 05 April 2007
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bako Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Bako View Drop Down
Newbie
Newbie


Joined: 05 April 2007
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bako Quote  Post ReplyReply Direct Link To This Post 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      
Back to Top
ijwelch View Drop Down
Senior Member
Senior Member


Joined: 20 June 2006
Status: Offline
Points: 262
Post Options Post Options   Thanks (0) Thanks(0)   Quote ijwelch Quote  Post ReplyReply Direct Link To This Post 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).
Back to Top
Bako View Drop Down
Newbie
Newbie


Joined: 05 April 2007
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bako Quote  Post ReplyReply Direct Link To This Post 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.



Back to Top
Bako View Drop Down
Newbie
Newbie


Joined: 05 April 2007
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bako Quote  Post ReplyReply Direct Link To This Post Posted: 29 November 2007 at 7:03am
In second sequence is error, of course.
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.188 seconds.