473,386 Members | 1,962 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Add control to Save File Dialog

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
Nov 20 '05 #1
6 13024
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
"Fergus Cooney" <fi******@tesco.net> wrote in message
news:#m**************@tk2msftngp13.phx.gbl...
Hi Thomas,

|| How can this be done in VB.NET?

Your question has a mistype. It should read "Can this be done in
VB.NET?" which makes it much simpler to answer. - No :-(

The Save File dialogue is a Windows dialogue and has nothing to do
with .NET. Any playing around with it (and it can be done) has to be
done using the Win32 Api.

Adding an extra combo box would be MAJOR work as you'd have to
increase the size of the window, rearrange all the other controls,
find a way to populate it, use the user's selection, etc, etc.

The most I've seen other peolpe do is trap mouse clicks on the
title bar so that they can call their own program but, even then, it's
specialised programming.

Your best option, if it is that important to you, is to roll up
your sleeves and create your own dialogue. Someone may have already
done this (it's highly likely in fact) but I don't know who and a
quick Google turned up nothing. You might get some joy if you go to
some of the programmer's web sites.

Good luck,
Fergus

Nov 20 '05 #2
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
Nov 20 '05 #3
> 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
"Fergus Cooney" <fi******@tesco.net> wrote in message
news:#$**************@tk2msftngp13.phx.gbl... 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

Nov 20 '05 #4
Thanks guys for the discussion on my behalf.

I just thought there would be an easier way to do this in .NET.

Doing some more research on this I found this web page which might
help:
http://www.vbaccelerator.com/home/VB...logs/index.asp

Thanks for your help anyway

Thomas

On Sat, 30 Aug 2003 09:06:37 +0100, "Tom Spink"
<th**********@ntlworld.com> wrote:
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.


Nov 20 '05 #5
Hello,

"Tom Spink" <th**********@ntlworld.com> schrieb:
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
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 20 '05 #6
Hello,

"Tom Spink" <th**********@ntlworld.com> schrieb:
Any details,especially the set-parent-from-windows-handle bit?


It requires hooking and threads...


You are right. Simple modifications can be done using a dialog hook (VB6
sample):

http://www.mvps.org/vbnet/code/hooks...ookadvtext.htm

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: S.W. Rasmussen | last post by:
With the risk of being accused of multi-posting I would like to draw the attention to a serious visual basic/windows issue discussed in the microsoft.public.vb.bugs newsgroup. As pointed out below...
1
by: ASH | last post by:
Hello all, I'm using the "API: Call Windows File Open/Save Dialog Box" to source the name of a file to open. The Dialog Box when called opens in the top left hand corner of the screen. I have...
2
by: SpotNet | last post by:
Hi Newsgroup, I have constructed highly customisable common dialog classes\objects. Decided to extend the Open\Save dialog options with the ability to change the text on all the controls. ...
4
by: Richard | last post by:
Hi I'm new to ASP/Web programming so any help would be appreciated... Situation: On my web page I would like to present a link {or button} that would allow the user to download a large file. ...
0
by: Dune | last post by:
Hi there, I have an aspx page that allows users to enter several parameters using drop downs and text boxes. The users then press a button that produces an extract based on the parameters they...
2
by: programmer2004 | last post by:
Hi I have used WebBrowser control and i want to save the entire webpage including pictures etc. i have called ExecWB method of WebBrowser control with OLECMDEXECOPT_DONTPROMPTUSER flag, but it...
3
by: =?Utf-8?B?YXNkZg==?= | last post by:
Hello. I am making a web application with c# and am using this code: Response.ContentType = "application/x-excel"; Response.AddHeader("Content-Disposition", "attachment;filename=" +...
2
by: vbaDev | last post by:
Hi. I am using Access 2000 and in my code I'm exporting a table into an Excel file (creating it), then the code needs to export another query into the same file (a new worksheet). So I needed both a...
1
by: sirimanna | last post by:
I want to know how can i open some text file data using microsoft common dialog control.6 I know how to save text data using microsoft common dialog control.6 code are here, ...
2
by: Artie | last post by:
Hi, I have a WebBrowser control displaying some formatted HTML. I need to be able to save the formatted HTML to a file, using the common Windows 'Save As' dialog, and preferably be able to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.