Пример #1
0
        private void EVESizeChange(object sender, EventArgs e)
        {
            string size = RTBMyText.SelectionFont.GetHeight().ToString();

            frmSizeOftext MySize = new frmSizeOftext();

            MySize.Owner = this;



            if (DialogResult.OK == MySize.ShowDialog())
            {
                string s     = MySize.Text;
                int    sizes = sizeOfMyText;

                try
                {
                    sizes = int.Parse(s);

                    if (int.Parse(s) < 0 || int.Parse(s) > 150)
                    {
                        MessageBox.Show("Size is incorrect");
                    }
                    else
                    {
                        RTBMyText.SelectionFont = new Font(MyFont.FontFamily, int.Parse(s), MyFont.Style);
                        MessageBox.Show("Ok");
                    }
                }
                catch
                {
                    MessageBox.Show("Size is incorrect");
                }

                sizeOfMyText = sizes;
            }
            else
            {
                MessageBox.Show("Cancel");
            }

            CreateFont(this, e);
        }
Пример #2
0
        private void EVESizeChange(object sender, EventArgs e)
        {
            string size = RTBMyText.SelectionFont.GetHeight().ToString();

            frmSizeOftext MySize = new frmSizeOftext();
            MySize.Owner = this;

            if (DialogResult.OK == MySize.ShowDialog())
            {

                string s = MySize.Text;
                int sizes = sizeOfMyText;

                try
                {
                    sizes = int.Parse(s);

                    if (int.Parse(s) < 0 || int.Parse(s) > 150)
                        {
                        MessageBox.Show("Size is incorrect");
                        }
                    else
                        {
                        RTBMyText.SelectionFont = new Font(MyFont.FontFamily, int.Parse(s), MyFont.Style);
                        MessageBox.Show("Ok");
                        }
                }
                catch
                {
                    MessageBox.Show("Size is incorrect");
                }

                sizeOfMyText = sizes;

            }
            else
            {
                MessageBox.Show("Cancel");
            }

            CreateFont(this, e);
        }