protected override void OnLoad(EventArgs e) { base.OnLoad(e); IActiveMenu menu = ActiveMenu.GetInstance(this); ActiveButton button = new ActiveButton(); button.BackColor = Color.Transparent; button.Text = "+"; button.Font = new System.Drawing.Font("Microsoft Sans Serif", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); button.Click += new EventHandler(myBtnClick); menu.Items.Add(button); }
private void CreateTopButtons() { IActiveMenu menu = ActiveMenu.GetInstance(this); ActiveButton button = new ActiveButton() { Image = Resources.pin12 }; button.Click += setOnTopClick; menu.Items.Add(button); ActiveButton linkButton = new ActiveButton() { Image = Resources.link }; linkButton.Click += openRepoLinkClick; menu.Items.Add(linkButton); }
/// <summary> /// Helper method for adding items to the menu bar. /// </summary> /// <param name = "text"></param> /// <param name = "handler"></param> private void AddButton(string text, EventHandler handler) { // get an instance of IActiveMenu used to attach // buttons to the form IActiveMenu menu = ActiveMenu.GetInstance(this); // define a new button ActiveButton button = new ActiveButton(); button.Text = text; menu.ToolTip.SetToolTip(button, "Tooltip " + button.Text); button.BackColor = colorSwitch.BackColor; button.Click += handler; // add the button to the menu menu.Items.Add(button); errorLabel.Text = ""; buttonText.Text = (buttonInt++).ToString(); }
private void AddDonateButton() { IActiveMenu menu = ActiveMenu.GetInstance(this); ActiveButton button = new ActiveButton(); button.Text = " " + Locale.localizedString("Get a donation key!", "License") + " "; button.Click += delegate { Utils.StartProcess(Preferences.instance().getProperty("website.donate")); }; menu.Items.Add(button); }