auto align the seleting line with one signal's edge.
fix flickering by replacing PaintDC to BufferedPaintDC, replacing Refresh the wdCanvas to pnlCanvas
comment the 'print'