Solved

Crazy question

Posted on 2002-03-22
13
140 Views
Last Modified: 2010-05-02
Is there a way?
In many application I must to call my forms MODALS,
but I need to be able to click in the form or the  pgm. that call my form(like: Internet Explorer) even if the form called is MODAL!!!!!!!!!

API(maybe)??

300points for the good answer.
Thanks
0
Comment
Question by:dosyl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
  • +2
13 Comments
 
LVL 6

Expert Comment

by:anthony_glenwright
ID: 6890240
Why do you have to call your forms as modal?  The desired behaviour you describe is that of non-modal forms.
0
 
LVL 1

Author Comment

by:dosyl
ID: 6890248
Because It is a ocx to use on Internet Explorer,VB, VFoxPro and anywhere. FoxPro, IE, need Modal form.
0
 
LVL 1

Author Comment

by:dosyl
ID: 6890250
Scuse it is LIKE a message, but the user must be able to click in the form that call the "message".
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 6

Expert Comment

by:anthony_glenwright
ID: 6890261
So you are calling a method and showing the form with code like:

frmMyForm.Show vbModal ?

Are you specifying an owner?  (as the second parameter to .show).  Do you get a particular error message if you show the form as non-modal?
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6891116
following Anthony's thinking:
frmMyForm.Show vbModeless, Me
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6891254
do you want something like a top most window (just like the help files)?

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long,
ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_SHOWWINDOW = &H40

Dim num As Integer
Dim chkChangeByPrm As Boolean

Public Function SetTop()
   SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, _
       SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE _
       Or SWP_NOSIZE
End Function

Public Function SetNOTOP()
   SetWindowPos hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, _
       SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE _
       Or SWP_NOSIZE
End Function
0
 
LVL 1

Author Comment

by:dosyl
ID: 6891354
emoreau, My form ia already on the top with: Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
but I must to be able click in the calling form.

anthony_glenwright
my form is call like this:
Form2.Show 1

else If I write it like this:From2.Show, the pgm. doesn't work.I have the message that the Non Modals Forms are not accepted.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6891577
if your form is already on top, remove the 1 after the show and it should work correctly.


>>else If I write it like this:From2.Show, the pgm. doesn't work.I have the message that the Non Modals
Forms are not accepted.

what is the err number? can you send and example of this application?
0
 
LVL 6

Expert Comment

by:anthony_glenwright
ID: 6891587
Hmm... I have actually run into this before, with a MS project add-in.  It also doesn't allow non-modal forms, and gives an error if you try to show one.

The bad news is, I never found a solution.
0
 
LVL 1

Author Comment

by:dosyl
ID: 6895391
emoreau:
The error is #406. I cannot remove the 1, else I have the error with IExplorer and FoxPro. If I keep the 1, I cannot access to the calling form.!!!!!

I tought something like a timer with the Interval 500 to set the focus to the calling form and set the focus to the called form every .5 second. But how???????????

Thnks anthony
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 300 total points
ID: 6895464
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7060605
This question appears to be abandoned. A question regarding it will be left in the Community Support
area; if you have any comment about the question, please leave it here.

Unless there is objection or further activity, one of the moderators will be asked to accept the comment
of <emoreau>.

The link to the Community Support area is:
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

DO NOT ACCEPT THIS COMMENT AS AN ANSWER.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7065747
Thanks, emoreau  for your help here.

I have finalized this question, and will monitor it for comments.

Moondancer - EE Moderator
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…
Suggested Courses
Course of the Month7 days, 17 hours left to enroll

617 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