コード例 #1
0
        private void ValidIdentiferToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SkorkInstructions si = new SkorkInstructions();
            Diag d = new Diag();

            si.CreateKey(d.ShowInputDialog("Enter a variable"),
                         (int.Parse(d.ShowInputDialog("Enter a int value", ""))));


            si.Temp();
        }
コード例 #2
0
        /// <summary>
        /// As long as each button child in the Parent ContextMenuStrip
        /// has a psuedo float tag where 1 = 1.0, this will find it and
        /// convert it.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void CtxZoomFactor_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            if (e.ClickedItem is ToolStripItem)
            {
                ToolStripMenuItem zoom = (ToolStripMenuItem)e.ClickedItem;
                Diag d = new Diag();
                try {
                    if (zoom.Tag.ToString() == null)
                    {
                        return;
                    }
                    else
                    {
                        if (zoom.HasDropDownItems)
                        {
                            foreach (ToolStripMenuItem i in zoom.DropDownItems)
                            {
                                if (i.Tag.ToString().Contains('.'))
                                {
                                    float zmFct = float.Parse(i.Tag.ToString());
                                    this.txtCode.ZoomFactor = zmFct;
                                    UpdateZoomFactor();
                                }
                            }
                        }

                        if (zoom.Tag.ToString().Contains('.'))
                        {
                            float zmFct = float.Parse(zoom.Tag.ToString());
                            this.txtCode.ZoomFactor = zmFct;
                            UpdateZoomFactor();
                        }
                        else if (zoom.Tag.ToString().ToLower() == "custom")
                        {
                            string s = "Enter a custom amount.:";
                            if (d.ShowInputDialog(s, "Skork").Equals(DialogResult.OK))
                            {
                            }
                        }
                    }
                } catch (Exception ex) {
                    MessageBox.Show(ex.Message);
                }
            }
        }