Link to home
Start Free TrialLog in
Avatar of danyb
danyb

asked on

vbModal/vbModeless

How can i change in runtime from vmModal to vbModeless of form.show?
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

You have to hide and re-show the form.

CHeers
Avatar of danyb
danyb

ASKER

Sorry, i forgat to mention that i'm loading the form from ActiveX DLL.
i try it and i receive the error message:
Sorry, I forget to mention that I’m loading the form from ActiveX DLL.
I try it and I receive the error message:
Run-time error '406': Non-modal forms cannot be displayed in
this host application from an ActiveX DLL, ActiveX Control or
Property Page.
ActiveX DLLs can show their own forms, as out-of-process components do. Interestingly, a form coming from an in-process component is automatically placed in front of forms from its client application, so you don't need to resort to the SetForegroundWindow API function to achieve the right behavior. Depending on the client's capabilities, however, an in-process component might not be able to display nonmodal forms. For example, programs written in Visual Basic 5 or 6, all the applications in the Microsoft Office 97 suite (or later versions), and all the third-party applications that have licensed the VBA language support nonmodal forms displayed by in-process components. On the other hand, programs written with Visual Basic 4 and all the applications found in previous versions of Microsoft Office raise an error 369 when a DLL component tries to display a nonmodal form.

Visual Basic enables you to test whether a client supports nonmodal forms through the App.NonModalAllowed read-only property. Microsoft suggests that you test this property before showing a nonmodal form from within a component, and degrade gracefully by showing a modal form if necessary:

If App.NonModalAllowed Then
    frmChart.Show
Else
    frmChart.Show vbModal
End If

 

Avatar of danyb

ASKER

I already know this, my problem is that i whold like to open my form as vbModeless (or change it in runtime) and trying to do this i get the error 406.
danyb, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Refund points and save as a 0-pt PAQ.

DanRollins -- EE database cleanup volunteer
ASKER CERTIFIED SOLUTION
Avatar of SpideyMod
SpideyMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial