none
create new control RRS feed

  • Question

  • Hi everyone, can anyone give me any idea about how to create new control like ColorDialog or  any dialog that that when I drag it to the form it's appeare in the bottom as component?

    Monday, June 23, 2008 7:31 PM

Answers

  • Beware that components like ColorDialog and OpenFileDialog are pretty special.  They are actually implemented by Windows Explorer and written in C++.  The .NET component is a thin wrapper around them to make them usable from a .NET project.  There are a bunch of P/Invoke calls inside them to initialize and display them and get the dialog results.

    The normal Windows Forms way to make a dialog is to design one with the WF form designer and display it with ShowDialog().  Wrapping such a dialog with a component is certainly possible but doesn't give a lot of bang for the buck.
    Tuesday, June 24, 2008 2:00 AM
    Moderator

All replies

  • Beware that components like ColorDialog and OpenFileDialog are pretty special.  They are actually implemented by Windows Explorer and written in C++.  The .NET component is a thin wrapper around them to make them usable from a .NET project.  There are a bunch of P/Invoke calls inside them to initialize and display them and get the dialog results.

    The normal Windows Forms way to make a dialog is to design one with the WF form designer and display it with ShowDialog().  Wrapping such a dialog with a component is certainly possible but doesn't give a lot of bang for the buck.
    Tuesday, June 24, 2008 2:00 AM
    Moderator