Common Dialog control's position...

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
buddypAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

VbmasterCommented:
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
VbmasterCommented:
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
prem_kumar_25Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
caraf_gCommented:
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
buddypAuthor Commented:
To,
caraf_g & prem_kumar_25

Thanks for your comment !

Thanks,
buddy
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.