コード例 #1
0
ファイル: DxControlForm.cs プロジェクト: dj-soft/GraphLibrary
        /// <summary>
        /// Do formuláře vytvoří buttony podle obsahu pole <see cref="_IButtons"/>.
        /// Buttony vytvoří, i když nemají být viditelné (<see cref="_ButtonsVisible"/>, to je úkolem metody <see cref="DoLayout"/>.
        /// </summary>
        private void CreateButtons()
        {
            RemoveButtons();

            var iButtons = _IButtons;

            if (iButtons is null)
            {
                return;
            }
            List <DxSimpleButton> buttonControls = new List <DxSimpleButton>();
            int x = 5;

            foreach (var iButton in iButtons)
            {
                var buttonControl = DxComponent.CreateDxSimpleButton(x, 0, 100, 20, this, iButton);
                buttonControl.Click += ButtonControl_Click;
                x += 105;
                buttonControls.Add(buttonControl);
            }
            _ButtonControls = buttonControls.ToArray();

            DoLayout();
        }