コード例 #1
0
        /// <summary>
        /// 设置地图属性
        /// </summary>
        private void SetMapPro()
        {
            PicturePro mapinfo = new PicturePro();

            mapinfo.mapId_tb.Text        = panel1.mapPro.MapID;
            mapinfo.mapName_tb.Text      = panel1.mapPro.MapName;
            mapinfo.IsRoad_check.Checked = panel1.mapPro.IsRoad == 1;
            mapinfo.url_tb.Text          = panel1.mapPro.MapAddress;
            mapinfo.text_filebk.Text     = @"BK/" + panel1.mapPro.MapName + ".png";
            if (mapinfo.ShowDialog() == DialogResult.OK)
            {
                this.panel1.mapPro.MapName        = mapinfo.mapName_tb.Text;
                this.panel1.mapPro.IsRoad         = mapinfo.IsRoad_check.Checked == true ? 1 : 0;
                this.panel1.mapPro.MapAddress     = mapinfo.url_tb.Text;
                this.panel1.mapPro.MapID          = mapinfo.mapId_tb.Text;
                this.panel1.BackgroundImageLayout = ImageLayout.Stretch;
                if (!string.IsNullOrEmpty(mapinfo.text_filebk.Text))
                {
                    this.panel1.SetBackgroud(mapinfo.text_filebk.Text);
                }
                else
                {
                    this.panel1.BackgroundImage = null;
                }
            }
            mapinfo.Close();
        }
コード例 #2
0
        private void contextMenuStrip1_ItemClicked(object sender, EventArgs e)
        {
            if (this.panel1.m_pCurrentObject == null)
            {
                //switch (e.ClickedItem.Name)
                //{
                //    case "pictruePro"://画面属性
                //        {
                PicturePro mapinfo = new PicturePro();
                mapinfo.mapId_tb.Text        = panel1.mapPro.mapId;
                mapinfo.mapName_tb.Text      = panel1.mapPro.mapName;
                mapinfo.IsRoad_check.Checked = panel1.mapPro.IsRoad == 1;
                mapinfo.url_tb.Text          = panel1.mapPro.mapAddress;
                mapinfo.text_filebk.Text     = this.panel1.mapPro.bkfile;
                if (mapinfo.ShowDialog() == DialogResult.OK)
                {
                    this.panel1.mapPro.mapName        = mapinfo.mapName_tb.Text;
                    this.panel1.mapPro.IsRoad         = mapinfo.IsRoad_check.Checked == true ? 1 : 0;
                    this.panel1.mapPro.mapAddress     = mapinfo.url_tb.Text;
                    this.panel1.mapPro.mapId          = mapinfo.mapId_tb.Text;
                    this.panel1.mapPro.bkfile         = mapinfo.text_filebk.Text;
                    this.panel1.BackgroundImageLayout = ImageLayout.Stretch;
                    if (!string.IsNullOrEmpty(panel1.mapPro.bkfile))
                    {
                        this.panel1.Size            = new Size(Image.FromFile(panel1.mapPro.bkfile).Width, Image.FromFile(panel1.mapPro.bkfile).Height);
                        this.panel1.BackgroundImage = Image.FromFile(panel1.mapPro.bkfile);
                    }
                    else
                    {
                        this.panel1.BackgroundImage = null;
                    }
                }
                mapinfo.Close();
                //}
                //break;
            }
            else
            {
                SetObjectPro();
            }
            //case "objectPro"://对象属性

            //break;
            //case "toTop":
            //    this.panel1.objectTop();
            //    break;
            //case "toBottom":
            //    this.panel1.objectBottom();
            //    break;
            //case "on":
            //    this.panel1.objectOn();
            //    break;
            //case "under":
            //    this.panel1.objectUnder();
            //    break;
        }