Add control to Save File Dialog

  • Thread starter Thread starter Thomas Schoch
  • Start date Start date
T

Thomas Schoch

I want to add a combobox to the save file dialog, where the user can
choose an additional option.

How can this be done in VB.NET?

Thomas
 
Actually, it's not as difficult as you think. The trick is to show the
dialog, grab the window handle and reset it's parent to belong to that of a
form. Then hide the border of the dialog and position it accordingly, then
add your controls underneath. Hey presto custom open file dialog.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit
 
Hi Tom,

|| Actually, it's not as difficult as you think.

Hurray, I sit happily corrected. Well done, that man. :-)

|| The trick is to show the dialog, grab the window handle
|| and reset it's parent to belong to that of a form.

Any details,especially the set-parent-from-windows-handle bit?

|| Then hide the border of the dialog and position it accordingly,
|| then add your controls underneath.

So there's no border? Add the controls to the dialogue or ??

Ahah! Is the "a form" mentioned above a new form which is to be a
host container for the dialogue and any extra controls (ie the
combobox)?

Any details about hiding the dialogue's borders (and title bar,
presumably, if it's being hosted)? Sounds like Win stuff to me.

Can you add anything about populating the combo box and doing
something with the selection, too?

Can you forgive me for giving you all these questions? lol.

Regards,
Fergus
 
Any details,especially the set-parent-from-windows-handle bit?

It requires hooking and threads...
Ahah! Is the "a form" mentioned above a new form which is to be a
host container for the dialogue and any extra controls (ie the
combobox)?

It most certainly is.
Can you add anything about populating the combo box and doing
something with the selection, too?

When the user has chosen OK on the OFD, just close the form, and return what
you need from the host form.

I've done it once in VB6, maybe I'll try again.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit
 
Hello,

Tom Spink said:
Actually, it's not as difficult as you think. The trick is to show the
dialog, grab the window handle and reset it's parent to belong to that of a
form. Then hide the border of the dialog and position it accordingly, then
add your controls underneath. Hey presto custom open file dialog.

Why not use dialog templates?

http://vbaccelerator.com/article.asp?id=1422

I know, it's VB Classic code, but maybe you have enough time to translate it
to VB .NET.

;-)

HTH,
Herfried K. Wagner
 
Back
Top