• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 157
  • Last Modified:

Common Dialog

HI,
When we have CommonDialog on a form, is possible to set the form on witch we want it appear;;else I will use the API to set the hwd.
0
dosyl
Asked:
dosyl
1 Solution
 
TimCotteeCommented:
Please explain, if you have a control on a form you can reference it from any other form:

frmMain.cdlgMain.ShowOpen

For example, what would you use an API call for here?
0
 
dosylAuthor Commented:
Like this:
Dim clOpen As CommonDialog

Set clOpen = frmMain.cdlOpen
clOpen.CancelError = True
clOpen.flags = cdlOFNHideReadOnly + cdlOFNOverwritePrompt + cdlOFNPathMustExist
clOpen.DialogTitle = "Save Bmp"
clOpen.Filter = "Bmp File|*.bmp"
clOpen.DefaultExt = "bmp"
clOpen.ShowSave

If I do like this, the CDlg don't appears on the front.It stays on the frmMain and I don't see it.
0
 
TimCotteeCommented:
I still don't see the problem, just because the dialog control doesn't appear on the second form doesn't mean you cannot use it, in fact you don't normally see this control at runtime anyway!
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
TimCotteeCommented:
I think I understand a little, do you mean that it effectively goes back to frmMain and redisplays it before displaying the showsave dialog and then doesn't return to your second form afterwards? If so then perhaps SetParent will work for you.
0
 
dosylAuthor Commented:
That's it, I never see the control cause it behind my second form, and because CommonDialog is modal I cannot click anyway.
0
 
TimCotteeCommented:
Though as you don't actually know the hWnd of the showSave window it may be a little difficult.
0
 
ebosscherCommented:
Why not just put a common dialog control on the form you want it to show up on?
0
 
dosylAuthor Commented:
ebosscher,
Instead of what you suggest I will use the API in a module and all forms will call the CommonDialog.
0
 
dosylAuthor Commented:
If noone give me the solution, I'll use API and delete this question.

Thanks to all.
0
 
DanRollinsCommented:
Hi dosyl,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Refund points and save as a 0-pt PAQ.

dosyl, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 
kodiakbearCommented:
Moving to the Paq

kb
Experts Exchange Moderator
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now