void SharpDXRadioButton_CheckedChangedEvent(object sender, EventArgs e)
 {
     if (this.Checked && this.Parent != null)
     {
         foreach (SharpDXControl control in this.Parent.ChildControls)
         {
             if (control == this)
             {
                 continue;
             }
             if (control is SharpDXRadioButton)
             {
                 SharpDXRadioButton rdb = (SharpDXRadioButton)control;
                 if (rdb.Checked && rdb.GroupName == this.GroupName)
                 {
                     rdb.Checked = false;
                 }
             }
         }
     }
 }
示例#2
0
        private static void InitializeComponent()
        {
            pnlPanel = new SharpDXPanel();
            pnlPanel.X = 2;
            pnlPanel.Y = 2;

            lblCaption = new SharpDXLabel();
            lblCaption.Text = "SteamMonsterGame";
            lblDescription = new SharpDXLabel();
            lblDescription.Text = "A sample of ExternalUtilsCSharp";

            btnToggleMenu = new SharpDXButton();
            btnToggleMenu.Text = "Toggle configuration-window";
            btnToggleMenu.MouseClickEventUp += btnToggleMenu_MouseClickEventUp;

            wndWindow = new SharpDXWindow();
            wndWindow.Text = "Configuration";
            wndWindow.Width = 400;
            wndWindow.Height = 200;
            wndWindow.X = 500;
            wndWindow.Y = 500;
            wndWindow.Visible = false;

            lblAutomation = new SharpDXLabel();
            lblAutomation.Text = "~ Automation ~";
            lblAutomation.FixedWidth = true;
            lblAutomation.Width = 150;
            lblAutomation.TextAlign = SharpDXLabel.TextAlignment.Center;
            chbAutoClicker = new SharpDXCheckBox();
            chbAutoClicker.Text = "[INS] Auto clicker";
            chbMoveMouse = new SharpDXCheckBox();
            chbMoveMouse.Text = "[DEL] Move mouse";
            rdbUsePost = new SharpDXRadioButton();
            rdbUsePost.Text = "[Use PostMessage]";
            rdbUsePost.Checked = true;
            rdbUseSend = new SharpDXRadioButton();
            rdbUseSend.Text = "[Use SendMessage]";
            rdbUseSend.Checked = false;

            lblVisuals = new SharpDXLabel();
            lblVisuals.Text = "~ Visuals ~";
            lblVisuals.FixedWidth = true;
            lblVisuals.Width = 150;
            lblVisuals.TextAlign = SharpDXLabel.TextAlignment.Center;
            chbVisDrawClicker = new SharpDXCheckBox();
            chbVisDrawClicker.Text = "Draw auto-clicker";
            lblPerformance = new SharpDXLabel();
            lblPerformance.Text = "~ Performance ~";
            lblPerformance.FixedWidth = true;
            lblPerformance.Width = 150;
            lblPerformance.TextAlign = SharpDXLabel.TextAlignment.Center;
            lblFpsLogic = new SharpDXLabel();
            lblFpsLogic.Text = "FPS logic: 0";
            pgbFpsLogic = new SharpDXProgressBar();
            pgbFpsLogic.Maximum = 60;
            lblFpsLogicAverage = new SharpDXLabel();
            lblFpsLogicAverage.Text = "Average FPS: 0 (0 ticks total)";
            lblFpsDraw = new SharpDXLabel();
            lblFpsDraw.Text = "FPS logic: 0";
            pgbFpsDraw = new SharpDXProgressBar();
            pgbFpsDraw.Maximum = 60;
            lblFpsDrawAverage = new SharpDXLabel();
            lblFpsDrawAverage.Text = "Average FPS: 0 (0 ticks total)";

            clkWindow = new ClickerWindow();
            clkWindow.X = 500;
            clkWindow.Y = 500;
            clkWindow.Width = 500;
            clkWindow.Height = 500;
        }
 private static void InitRadioButton(ref SharpDXRadioButton control, string text, object tag, bool bChecked)
 {
     control = new SharpDXRadioButton();
     control.Text = text;
     control.Tag = tag;
     control.Checked = bChecked;
     control.CheckedChangedEvent += radioButton_CheckedChanged;
 }