Solved

vbModal/vbModeless

Posted on 2002-05-07
6
1,010 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DIR issue 7 50
Put text in a picture ASP.NET C# 2 50
How to measure sizes and angles in scanned images ? 3 52
IF ELSE Statement in Excel Macro VBA 16 30
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

912 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

20 Experts available now in Live!

Get 1:1 Help Now