Solved

vbModal/vbModeless

Posted on 2002-05-07
6
1,007 Views
Last Modified: 2012-05-04
How can i change in runtime from vmModal to vbModeless of form.show?
0
Comment
Question by:danyb
6 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6995929
You have to hide and re-show the form.

CHeers
0
 

Author Comment

by:danyb
ID: 6996000
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.
0
 
LVL 2

Expert Comment

by:corvanderlinden
ID: 6996309
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

 

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:danyb
ID: 6996519
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.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7722415
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
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 7780216
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now