Download demo project - 14 Kb
Download source files - 2 Kb
This class is used to implement the same feature seen in the popular Winamp player. With
this class you are able to snap the dialog to the screen border. If you drag the dialog near
the screen border, the dialog will automatically stick on the screen border (like a magnet).
How to use it
- Add SnapDialog.h and SnapDialog.cpp to your project.
- Add #include "SnapDialog.h" in your dialog class.
- Replace all occurrence of CDialog in your dialog class by CSnapDialog.
To change the limit after which the dialog is automatically stickled to the screen border, set
these two variables. Default values are 15 pixels.
m_nXOffset = 15;
m_nYOffset = 15;