Exemplo n.º 1
0
        private void OpenWindow(ControlBase control, EventArgs args)
        {
            Window window = new Window(this);

            window.Title   = String.Format("Window ({0})", ++m_WindowCount);
            window.Size    = new Size(m_Rand.Next(200, 400), m_Rand.Next(200, 400));
            window.Left    = m_Rand.Next(700);
            window.Top     = m_Rand.Next(400);
            window.Padding = new Padding(6, 3, 6, 6);

            RadioButtonGroup rbg = new RadioButtonGroup(window);

            rbg.Dock = Dock.Top;
            rbg.AddOption("Resize disabled", "None").Checked += (c, a) => window.Resizing = Resizing.None;
            rbg.AddOption("Resize width", "Width").Checked   += (c, a) => window.Resizing = Resizing.Width;
            rbg.AddOption("Resize height", "Height").Checked += (c, a) => window.Resizing = Resizing.Height;
            rbg.AddOption("Resize both", "Both").Checked     += (c, a) => window.Resizing = Resizing.Both;
            rbg.SetSelectionByName("Both");

            LabeledCheckBox dragging = new LabeledCheckBox(window);

            dragging.Dock          = Dock.Top;
            dragging.Text          = "Dragging";
            dragging.IsChecked     = true;
            dragging.CheckChanged += (c, a) => window.IsDraggingEnabled = dragging.IsChecked;
        }