Exemplo n.º 1
0
        private void Button11_Click(object sender, EventArgs e)
        {
            MessageBox.Show(Typography.INCHtoCM(textBox17.Text, true, true, 2, "Error!") + " - INCH => CM");
            MessageBox.Show(Typography.INCHtoPX(textBox17.Text, true, true, 2, "Error!") + " - INCH => PX");

            MessageBox.Show(Typography.CMtoINCH(textBox17.Text, true, true, 2, "Error!") + " - CM => INCH");
            MessageBox.Show(Typography.CMtoPX(textBox17.Text, true, true, 2, "Error!") + " - CM => PX");

            MessageBox.Show(Typography.PXtoINCH(textBox17.Text, true, true, 2, "Error!") + " - PX => INCH");
            MessageBox.Show(Typography.PXtoCM(textBox17.Text, true, true, 2, "Error!") + " - PX => CM");
        }
Exemplo n.º 2
0
        private void CTB_Click(object sender, EventArgs e)
        {
            try
            {
                string TA = TACB.SelectedItem.ToString();
                string TB = TBCB.SelectedItem.ToString();
                int    PC = string.IsNullOrEmpty(BTTB.Text) ? 2 : Convert.ToInt32(BTTB.Text);
                BTTB.Text = PC.ToString();

                if (TA == "INCH")
                {
                    if (TB == "CM")
                    {
                        TRTB.Text = Typography.INCHtoCM(TVTB.Text, DL, CA, PC);
                    }
                    else if (TB == "PX")
                    {
                        TRTB.Text = Typography.INCHtoPX(TVTB.Text, DL, CA, PC);
                    }
                }
                else if (TA == "CM")
                {
                    if (TB == "INCH")
                    {
                        TRTB.Text = Typography.CMtoINCH(TVTB.Text, DL, CA, PC);
                    }
                    else if (TB == "PX")
                    {
                        TRTB.Text = Typography.CMtoPX(TVTB.Text, DL, CA, PC);
                    }
                }
                else if (TA == "PX")
                {
                    if (TB == "INCH")
                    {
                        TRTB.Text = Typography.PXtoINCH(TVTB.Text, DL, CA, PC);
                    }
                    else if (TB == "CM")
                    {
                        TRTB.Text = Typography.PXtoCM(TVTB.Text, DL, CA, PC);
                    }
                }
            }
            catch
            {
                //
            }
        }
Exemplo n.º 3
0
        private void Button21_Click(object sender, EventArgs e)
        {
            try
            {
                ComboBox();
                if (string.IsNullOrEmpty(textBox15.Text))
                {
                    textBox15.Text = "1";
                }

                if (Selection13 == "INCH")
                {
                    if (Selection14 == "CM")
                    {
                        textBox16.Text = Typography.INCHtoCM(textBox17.Text, Selection15, Selection16, Convert.ToInt32(textBox15.Text), "Error!");
                    }
                    else if (Selection14 == "PX")
                    {
                        textBox16.Text = Typography.INCHtoPX(textBox17.Text, Selection15, Selection16, Convert.ToInt32(textBox15.Text), "Error!");
                    }
                    else
                    {
                        textBox16.Text = "Error!";
                    }
                }
                else if (Selection13 == "CM")
                {
                    if (Selection14 == "INCH")
                    {
                        textBox16.Text = Typography.CMtoINCH(textBox17.Text, Selection15, Selection16, Convert.ToInt32(textBox15.Text), "Error!");
                    }
                    else if (Selection14 == "PX")
                    {
                        textBox16.Text = Typography.CMtoPX(textBox17.Text, Selection15, Selection16, Convert.ToInt32(textBox15.Text), "Error!");
                    }
                    else
                    {
                        textBox16.Text = "Error!";
                    }
                }
                else if (Selection13 == "PX")
                {
                    if (Selection14 == "INCH")
                    {
                        textBox16.Text = Typography.PXtoINCH(textBox17.Text, Selection15, Selection16, Convert.ToInt32(textBox15.Text), "Error!");
                    }
                    else if (Selection14 == "CM")
                    {
                        textBox16.Text = Typography.PXtoCM(textBox17.Text, Selection15, Selection16, Convert.ToInt32(textBox15.Text), "Error!");
                    }
                    else
                    {
                        textBox16.Text = "Error!";
                    }
                }
                button18.Cursor = Cursors.Hand;
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message);
            }
        }