Inheritance: System.Windows.Forms.UserControl
Exemplo n.º 1
0
 public TextureAlternative()
 {
     InitializeComponent();
     SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true);
     pictureBox.MouseWheel += new MouseEventHandler(OnMouseWheel);
     refMarker = this;
 }
Exemplo n.º 2
0
        private void SearchGraphic(object sender, EventArgs e)
        {
            int  graphic;
            bool candone;

            if (textBoxGraphic.Text.Contains("0x"))
            {
                string convert = textBoxGraphic.Text.Replace("0x", "");
                candone = int.TryParse(convert, System.Globalization.NumberStyles.HexNumber, null, out graphic);
            }
            else
            {
                candone = int.TryParse(textBoxGraphic.Text, System.Globalization.NumberStyles.Integer, null, out graphic);
            }

            if (candone)
            {
                bool res;
                if (Options.DesignAlternative)
                {
                    res = TextureAlternative.SearchGraphic(graphic);
                }
                else
                {
                    res = Texture.SearchGraphic(graphic);
                }
                if (!res)
                {
                    DialogResult result = MessageBox.Show("No texture found", "Result", MessageBoxButtons.OKCancel, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                    if (result == DialogResult.Cancel)
                    {
                        Close();
                    }
                }
            }
        }