Print Page | Close Window

BUG: FormExtender problem with modal form

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=13632
Printed Date: 22 November 2024 at 7:32pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: BUG: FormExtender problem with modal form
Posted By: MNovaro
Subject: BUG: FormExtender problem with modal form
Date Posted: 10 March 2009 at 3:57am
Hello, all

I'm using form extender to save / restore placement of my forms. But, I have a problem with modal forms: I get the error

"Form is already displayed, can't show modally"

To test, simply add two forms (Form1, Form2), and add FormExtender (frmExt) to Form2, using:

Private Sub Form_Load()
    frmExt.RestorePlacement "TMP", "tmp", "tmp"
End Sub

Private Sub Form_Unload(Cancel As Integer)
    frmExt.SavePlacement "TMP", "tmp", "tmp"
End Sub

Now, from Form1 call Form2 modally:

Private Sub Command1_Click()
    Form2.Show vbModal, Me
End Sub



This works the first time (i.e. when RestorePlacement has no saved position in it), but it fails on the second click (i.e. after saving the placement).

Any help would be grealtly appreciated.

Thanks
Marco




Replies:
Posted By: Aaron
Date Posted: 10 March 2009 at 8:33am
Hi Marco,
 
Yes you are right about this, I can confirm that this a bug.
 
Seems that RestorePlacement creates instance of the form and show the form in the last saved position...
 
Just call RestorePlacement in Command1_Click:
 

Private Sub Command1_Click()
    Form2.frmExt.RestorePlacement "TMP", "tmp", "tmp"
End Sub

 
 
and you will see that form is showing. Now to set it to vbModal is going to be a problem...
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: MNovaro
Date Posted: 10 March 2009 at 9:20am
Hi Aaron,

thanks for the reply.
Actually, I found out that placing the RestorePlacement in the Form2 Form_Activate event works, but I can see the form "flicker", since it is shown for one instant in the "old" position, then restored to the correct one...

I hopw CJ will come out with a fix for this (should I point out this to the support team, opening a new ticket?)

Thanks again
Marco


Posted By: Aaron
Date Posted: 10 March 2009 at 9:35am
Hi Marco,
 
You don't need to create new post for this just change Topic Description into: BUG: FormExtender problem with modal form
 
and Oleg will respond
 
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: MNovaro
Date Posted: 10 March 2009 at 10:01am





Posted By: MNovaro
Date Posted: 25 March 2009 at 4:11am
Edit: Any news in here??


Posted By: Oleg
Date Posted: 26 March 2009 at 2:55am
Hi,
 
We can try hide it again with
 
Private Sub Form_Load()
    FormExtender1.RestorePlacement "TMP", "tmp", "tmp"
    Me.Visible = False
End Sub
 
 


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


Posted By: MNovaro
Date Posted: 26 March 2009 at 3:52am
Yes, this works: thanks.
Anyhow, I was wondering if you are going to fix this in the next release...


Posted By: Oleg
Date Posted: 26 March 2009 at 5:30am
Hello,
 
Yes, we will change it. thanks.


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



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