?
Solved

Common Dialog control's position...

Posted on 1999-12-09
5
Medium Priority
?
181 Views
Last Modified: 2013-12-26
To,
Experts
I want to show it onto the middle of my form.

Currently it is open on left corner of the form.

I am eagerly waiting for your reply.

Thanks,
buddy
0
Comment
Question by:buddyp
5 Comments
 
LVL 7

Expert Comment

by:Vbmaster
ID: 2270723
The 'standard' solution is to create a dummy form and put the common dialog control there. Whenever you want to show a dialog control you use the one on the dummy form. The position of the dialog control will show up in the left top corner of the dummy form, so you can put it anywhere on the form if you set the Left and Top property of the dummy form before showing the dialog.

Of course the dummy form don't have to be visible for this to work.
0
 
LVL 7

Expert Comment

by:Vbmaster
ID: 2270725
correction..

".., so you can put it anywhere on the form if you set the Left and Top property .."

should be

".., so you can put it anywhere on the SCREEN if you set the Left and Top property .."
0
 
LVL 1

Accepted Solution

by:
prem_kumar_25 earned 80 total points
ID: 2270801
Create the form Place the Commondialog Control Then Run The  Code . At the begining The Common dialog box will be at The left corner or some where . Drag it to the center of the the screen . From here onwards it will be There it self until u drag it to a new position

Hope this will solve ur problem
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2271913
Wrong, wrong, wrong...

Vbmaster gave the right answer.

Instead of a dummy form though, you could create a picture box, and place your common dialog control on it. At position 0,0 relative to the picture box. Set the picture box's border style to None, and make its width and height 0 (at run time).

Follow VBmaster's recipe, using the Picture box instead of the dummy form.

Because the picture box is a child of the form it's on, the location of the Common Dialog will be relative to the form.

Also, it saves you having to introduce an extra form just for the purpose of displaying a common dialog.
0
 

Author Comment

by:buddyp
ID: 2271922
To,
caraf_g & prem_kumar_25

Thanks for your comment !

Thanks,
buddy
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Suggested Courses

593 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