Пример #1
0
        // Zoom control - Increase, Decrease, Reset
        private void Tsmi_ZoomControlManager_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender;

            switch (clickedItem.Text)
            {
            case "Restore Default Zoom":
            {
                rt_CodeEditor.ZoomFactor = ZoomControl.SetZoom(ZoomState.Default, rt_CodeEditor.ZoomFactor,
                                                               ZoomControl.ZoomStep);
                break;
            }

            case "Zoom Increase":
            {
                rt_CodeEditor.ZoomFactor = ZoomControl.SetZoom(ZoomState.Increase, rt_CodeEditor.ZoomFactor,
                                                               ZoomControl.ZoomStep);
                break;
            }

            case "Zoom Decrease":
            {
                rt_CodeEditor.ZoomFactor = ZoomControl.SetZoom(ZoomState.Decrease, rt_CodeEditor.ZoomFactor,
                                                               ZoomControl.ZoomStep);
                break;
            }
            }

            Sddb_zoom.Text = ZoomControl.GetZoomString(rt_CodeEditor.ZoomFactor);
        }
Пример #2
0
        private void Tsmi_CustomZoom_Click(object sender, EventArgs e)
        {
            // Set's the custom zoom level of the code editor. The ToolStripMenuItem Tag contains the zoom value.
            ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender;

            rt_CodeEditor.ZoomFactor = ZoomControl.SetZoom(ZoomState.Custom, rt_CodeEditor.ZoomFactor,
                                                           float.Parse(clickedItem.Tag.ToString()));
            Sddb_zoom.Text = ZoomControl.GetZoomString(rt_CodeEditor.ZoomFactor);
        }