Solved

Common Dialog

Posted on 2002-03-22
11
141 Views
Last Modified: 2010-05-02
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
Comment
Question by:dosyl
11 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 6888812
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
 
LVL 1

Author Comment

by:dosyl
ID: 6888838
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
 
LVL 43

Expert Comment

by:TimCottee
ID: 6888865
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
 
LVL 43

Expert Comment

by:TimCottee
ID: 6888878
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
 
LVL 1

Author Comment

by:dosyl
ID: 6888883
That's it, I never see the control cause it behind my second form, and because CommonDialog is modal I cannot click anyway.
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

 
LVL 43

Expert Comment

by:TimCottee
ID: 6888898
Though as you don't actually know the hWnd of the showSave window it may be a little difficult.
0
 
LVL 6

Expert Comment

by:ebosscher
ID: 6888907
Why not just put a common dialog control on the form you want it to show up on?
0
 
LVL 1

Author Comment

by:dosyl
ID: 6888946
ebosscher,
Instead of what you suggest I will use the API in a module and all forms will call the CommonDialog.
0
 
LVL 1

Author Comment

by:dosyl
ID: 6891415
If noone give me the solution, I'll use API and delete this question.

Thanks to all.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7634258
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
 
LVL 1

Accepted Solution

by:
kodiakbear earned 0 total points
ID: 7666137
Moving to the Paq

kb
Experts Exchange Moderator
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

760 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

17 Experts available now in Live!

Get 1:1 Help Now