Common Dialog - how to put on a form

S

Steve Barnett

I need to include a wizard in my application that will, as one of the steps,
ask the user to select a file to open and (later) a file to save it as. The
naff way to do this would be to have a button on the form that pops-up the
common dialog. The cool way to do this would be to have the common dialog
embedded in the wizard.

I know it's possible, as I've seen other apps do this kind of thing, but I
have no ideas how it can be achieved and have failed miserably to find any
sample code on the web.

Does anyone know how I can do this please? (It also fixes another problem
I'm going to have where I need to add check boxes to the standard open
dialog). I would prefer to use the standard common dialog over writing a
control of my own as it gives so much additional functionality.

Thanks
Steve
 
N

Nicholas Paldino [.NET/C# MVP]

Steve,

Personally, I would be used to a dialog. However, what you see is
usually a custom control that is embedded in the wizard itself.

Hope this helps.
 
S

Steve Barnett

The question is, however, how do I create such a custom control? From what
I can see, if I want to use the common dialog, I can only pop it up, I can't
use it like a custom control.

Steve

Nicholas Paldino said:
Steve,

Personally, I would be used to a dialog. However, what you see is
usually a custom control that is embedded in the wizard itself.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Steve Barnett said:
I need to include a wizard in my application that will, as one of the
steps, ask the user to select a file to open and (later) a file to save it
as. The naff way to do this would be to have a button on the form that
pops-up the common dialog. The cool way to do this would be to have the
common dialog embedded in the wizard.

I know it's possible, as I've seen other apps do this kind of thing, but
I have no ideas how it can be achieved and have failed miserably to find
any sample code on the web.

Does anyone know how I can do this please? (It also fixes another problem
I'm going to have where I need to add check boxes to the standard open
dialog). I would prefer to use the standard common dialog over writing a
control of my own as it gives so much additional functionality.

Thanks
Steve
 
N

Nicholas Paldino [.NET/C# MVP]

Steve,

That's my point, you would have to create listboxes, treeviews, etc,
etc, to mimic the functionality. You can't just embed it.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Steve Barnett said:
The question is, however, how do I create such a custom control? From
what I can see, if I want to use the common dialog, I can only pop it up,
I can't use it like a custom control.

Steve

Nicholas Paldino said:
Steve,

Personally, I would be used to a dialog. However, what you see is
usually a custom control that is embedded in the wizard itself.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Steve Barnett said:
I need to include a wizard in my application that will, as one of the
steps, ask the user to select a file to open and (later) a file to save
it as. The naff way to do this would be to have a button on the form that
pops-up the common dialog. The cool way to do this would be to have the
common dialog embedded in the wizard.

I know it's possible, as I've seen other apps do this kind of thing, but
I have no ideas how it can be achieved and have failed miserably to find
any sample code on the web.

Does anyone know how I can do this please? (It also fixes another
problem I'm going to have where I need to add check boxes to the
standard open dialog). I would prefer to use the standard common dialog
over writing a control of my own as it gives so much additional
functionality.

Thanks
Steve
 
S

SpotNet

Steve,

How familiar are you with API's? That is contructing the relevent common
dialog(s) from the API's, using callbacks, hook procedures and defining
customised templates (the wizard form would more or less be that template).

Going on Nicholas's responses to this;

1) This isn't all that difficult once you know how to do it.
2) Even if you know how to do it, it could be 'a little (like alot)' time
consuming.

On that note, it would be easier and quicker to define dropdown lists,
listview controls,... to do this. Using the Common Dialogs as defined in the
Windows.Forms namespace, I would not know if it's possible.

Hope this sheds some light for you.

Regards,
- SpotNet


:I need to include a wizard in my application that will, as one of the
steps,
: ask the user to select a file to open and (later) a file to save it as.
The
: naff way to do this would be to have a button on the form that pops-up the
: common dialog. The cool way to do this would be to have the common dialog
: embedded in the wizard.
:
: I know it's possible, as I've seen other apps do this kind of thing, but I
: have no ideas how it can be achieved and have failed miserably to find any
: sample code on the web.
:
: Does anyone know how I can do this please? (It also fixes another problem
: I'm going to have where I need to add check boxes to the standard open
: dialog). I would prefer to use the standard common dialog over writing a
: control of my own as it gives so much additional functionality.
:
: Thanks
: Steve
:
:
 
S

Steve Barnett

I suspect that I'm not familiar enough with APIs to be able to do this. I
had this functionality in one of my old VB6 apps, but it was provided via a
set of classes I found on vbaccelerator.com. I've looked at the code and
got myself lost in the logic several times.

Perhaps I should just stick to combos and list views and put up with the
loss of functionality.

Thanks
Steve
 
S

SpotNet

Great samples at vbaccelerator.com. The coders have indeed used the common
dialog API's, types, delegates,... achieve the functionality. If you get the
time to do so Steve, construct your own Common Dialog namespace, from the
ground up. This will take some time especially to perfect them, but this
will be the time consuming part. From then on you'll have very flexible
common dialog functionality.

Regards,
- SpotNet

:I suspect that I'm not familiar enough with APIs to be able to do this. I
: had this functionality in one of my old VB6 apps, but it was provided via
a
: set of classes I found on vbaccelerator.com. I've looked at the code and
: got myself lost in the logic several times.
:
: Perhaps I should just stick to combos and list views and put up with the
: loss of functionality.
:
: Thanks
: Steve
:
: : >
: > Steve,
: >
: > How familiar are you with API's? That is contructing the relevent common
: > dialog(s) from the API's, using callbacks, hook procedures and defining
: > customised templates (the wizard form would more or less be that
: > template).
: >
: > Going on Nicholas's responses to this;
: >
: > 1) This isn't all that difficult once you know how to do it.
: > 2) Even if you know how to do it, it could be 'a little (like alot)'
time
: > consuming.
: >
: > On that note, it would be easier and quicker to define dropdown lists,
: > listview controls,... to do this. Using the Common Dialogs as defined in
: > the
: > Windows.Forms namespace, I would not know if it's possible.
: >
: > Hope this sheds some light for you.
: >
: > Regards,
: > - SpotNet
: >
: >
: > : > :I need to include a wizard in my application that will, as one of the
: > steps,
: > : ask the user to select a file to open and (later) a file to save it
as.
: > The
: > : naff way to do this would be to have a button on the form that pops-up
: > the
: > : common dialog. The cool way to do this would be to have the common
: > dialog
: > : embedded in the wizard.
: > :
: > : I know it's possible, as I've seen other apps do this kind of thing,
but
: > I
: > : have no ideas how it can be achieved and have failed miserably to find
: > any
: > : sample code on the web.
: > :
: > : Does anyone know how I can do this please? (It also fixes another
: > problem
: > : I'm going to have where I need to add check boxes to the standard open
: > : dialog). I would prefer to use the standard common dialog over writing
a
: > : control of my own as it gives so much additional functionality.
: > :
: > : Thanks
: > : Steve
: > :
: > :
: >
: >
:
:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top