![]() |
Form_Resize and Vista |
Post Reply ![]() |
Author | |
Bako ![]() Newbie ![]() Joined: 05 April 2007 Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() 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. |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
Please attach full project to test.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Bako ![]() Newbie ![]() Joined: 05 April 2007 Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() |
![]() |
|
gaudetm ![]() Senior Member ![]() ![]() Joined: 23 September 2006 Location: Canada Status: Offline Points: 134 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Him
don't put SkinFramework1.ApplyOptions and SkinFramework1.ApplyWindow to Activate event Move them to Load
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Bako ![]() Newbie ![]() Joined: 05 April 2007 Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Bako ![]() Newbie ![]() Joined: 05 April 2007 Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() |
Does anybody fix this problem?
|
|
![]() |
|
ijwelch ![]() Senior Member ![]() Joined: 20 June 2006 Status: Offline Points: 262 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Bako ![]() Newbie ![]() Joined: 05 April 2007 Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
ijwelch ![]() Senior Member ![]() Joined: 20 June 2006 Status: Offline Points: 262 |
![]() ![]() ![]() ![]() ![]() |
No, the example you posted only checked for WindowState=vbMinimized.
|
|
![]() |
|
Bako ![]() Newbie ![]() Joined: 05 April 2007 Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() |
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. |
|
![]() |
|
Bako ![]() Newbie ![]() Joined: 05 April 2007 Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
ijwelch ![]() Senior Member ![]() Joined: 20 June 2006 Status: Offline Points: 262 |
![]() ![]() ![]() ![]() ![]() |
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). |
|
![]() |
|
Bako ![]() Newbie ![]() Joined: 05 April 2007 Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() |
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. |
|
![]() |
|
Bako ![]() Newbie ![]() Joined: 05 April 2007 Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() |
In second sequence is error, of course.
![]() |
|
![]() |
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 |