예제 #1
0
        public void PopupLayer(Type type, object sender)
        {
            Control       c    = sender as Control;
            ToolStripItem item = sender as ToolStripItem;

            bool           isShow;
            FloatLayerBase p = CreateLayer(type, out isShow);

            if (isShow)
            {
                if (c != null)
                {
                    p.Show(c);
                }
                else
                {
                    p.Show(item);
                }
            }
            else
            {
                var result = c != null?p.ShowDialog(c) : p.ShowDialog(item);

                txbResult.AppendText(result + "\r\n");
            }
        }
예제 #2
0
        private void txbPopupFromTextBox_Click(object sender, EventArgs e)
        {
            using (FloatLayerBase p = CreateLayer(typeof(CalcPopDemo)))
            {
                if (p.ShowDialog(txbPopupFromTextBox) != System.Windows.Forms.DialogResult.OK)
                {
                    return;
                }

                txbPopupFromTextBox.Text = ((CalcPopDemo)p).Result.ToString();
            }
        }
예제 #3
0
        private void textBox1_Click(object sender, EventArgs e)
        {
            using (FloatLayerBase p = OwnerOrParent.CreateLayer(typeof(CalcPopDemo)))
            {
                if (p.ShowDialog(textBox1) != System.Windows.Forms.DialogResult.OK)
                {
                    return;
                }

                textBox1.Text = ((CalcPopDemo)p).Result.ToString();
            }
        }