コード例 #1
0
        public MapForm()
        {
            InitializeComponent();

            this.mapDrow = new MouseMapDraw();

            this.mapDrow.Width  = 12;
            this.mapDrow.Height = 60;
        }
コード例 #2
0
        /// <summary>
        /// 產生地圖
        /// </summary>
        private void GenerateMap_Click(object sender, EventArgs e)
        {
            int x   = 0;
            int y   = 0;
            int gap = 0;

            try
            {
                x = Int16.Parse(this.x_box.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show("X資料錯誤\n" + ex.Message, "警告");
            }
            try
            {
                y = Int16.Parse(this.y_box.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show("X資料錯誤\n" + ex.Message, "警告");
            }
            try
            {
                gap = Int16.Parse(this.gaps.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show("間隙資料錯誤\n" + ex.Message, "警告");
            }

            if (this.mapDrow == null)
            {
                this.mapDrow = new MouseMapDraw();
            }

            try
            {
                this.mapDrow.Height = Int16.Parse(this.height.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show("寬度資料錯誤\n" + ex.Message, "警告");
            }
            try
            {
                this.mapDrow.Width = Int16.Parse(this.width.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show("長度資料錯誤\n" + ex.Message, "警告");
            }
            this.CreateMap(x, y, gap);
        }