//printing private void PrintSetup(object sender, EventArgs e) { if (MDockArea.ActiveDocument.GetType().Equals(typeof(CodeEditor))) { CodeEditor ce = (CodeEditor)MDockArea.ActiveDocument; ce.PageSetup(); } }