internal static void LoadButtonsList() { ButtonsList.Clear(); ButtonsList.Add(null); StaticButtonsList.Clear(); StaticButtonsList.Add(null); for (int i = 1; i <= 9; i++) { Button b = (Button)MainForm.Controls["button" + i]; ButtonsList.Add(b); StaticButtonsList.Add(b); } }
public static void CreateButtonNoClickEvent(string text = "") { var button = new DataButton() { Name = $"{BaseName}{Index}", Text = text, Width = Width, Location = new Point(Left, Top), Parent = ParentControl, Visible = true }; button.Click += EventHandler; ButtonsList.Add(button); ParentControl.Controls.Add(button); Top += HeightPadding; Index += 1; }
public MainWindowVM() { MessengerInstance.Register <FlowDocumentInitMessage>(this, msg => { _viewGuid = msg.Id; _view = ( MainWindow )msg.View; _content = msg.Output; Initialize(); }); MessengerInstance.Register <DecisionMessage>(this, msg => { ButtonsList.Clear(); for (var i = 0; i < msg.DecisionCount; i++) { var dbvm = new DecisionButtonVM(msg.Decisions[i]); dbvm.DidSelectButton += Dbvm_DidSelectButton; ButtonsList.Add(dbvm); } RaisePropertyChanged(() => ButtonsList); }); }
public void RecreateButtons(int buttons) { mainArea.Background = Brushes.White; for (int i = 0; i < buttons; i++) { var createdButton = new MazeButton() { Width = 20, Height = 20, IsBlock = false, IsEndPoint = false, IsStartPoint = false, IsVisited = false, Father = this, //Content = i }; ButtonsList.Add(createdButton); mainArea.Children.Add(createdButton); } }
private void CreateButtons() { //input number int i = Inputs.Count + 1; foreach (string name in Buttons) { //button Button button = new Button(); button.TabIndex = 5; button.Text = name; button.Name = name; button.Location = new Point(InputPositionX - 1, ElementPositionY(i) - 1); button.Size = new Size(ButtonWidth + 2, ButtonDoubleHeight + 2); ButtonsList.Add(name, button); Form.Controls.Add(button); //increase input number i += 2; } }
public static void CreateCategoryButton(string text, int categoryIdentifier) { var button = new DataButton() { Name = $"{BaseName}{Index}", Text = text, Width = Width, Location = new Point(Left, Top), Parent = ParentControl, Identifier = categoryIdentifier, Visible = true, ImageAlign = ContentAlignment.MiddleLeft, TextAlign = ContentAlignment.MiddleRight }; button.Click += EventHandler; ButtonsList.Add(button); ParentControl.Controls.Add(button); Top += HeightPadding; Index += 1; }
// Use this for initialization void Start() { //Set Position to 0 transform.position = Vector3.zero; //Create button actions. AccessPoint.SetAction("Open"); ResetButton.SetAction("ResetAction"); OptionsButton.SetAction("OptionsAction"); QuitButton.SetAction("QuitAction"); //Populate the button list. //ButtonsList.Add(AccessPoint); ButtonsList.Add(OptionsButton); ButtonsList.Add(ResetButton); ButtonsList.Add(QuitButton); //Close the menu and dont show the animation when started CurrentState = MenuState.Closed; timer.Fill(); menuactive = false; }