/// <summary> /// 根据选择的日期索引,从数据库中取得图片 /// </summary> /// <param name="index"></param> /// <returns></returns> private void GetImage(string date) { List <string> comment = new List <string>(); List <Image> imgs = MapDBClass.GetPicure(_MapId, _LayerId, _ObjectId, date, comment); tabControl1.TabPages.Clear(); int index = 0; foreach (Image img in imgs) { index++; TextBox box = new TextBox(); box.Text = comment[index - 1]; box.Multiline = true; box.WordWrap = false; box.ScrollBars = ScrollBars.Both; box.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right; PictureBox pic = new PictureBox(); pic.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom; pic.Image = img; pic.SizeMode = PictureBoxSizeMode.Zoom; TabPage page = new TabPage(index.ToString()); tabControl1.TabPages.Add(page); page.Controls.Add(box); page.Controls.Add(pic); box.Left = 0; box.Top = 0; box.Width = page.Width; box.Height = 50; pic.Left = 0; pic.Top = 55; pic.Width = page.Width; pic.Height = page.Height - pic.Top; pic.Refresh(); } btnDelete.Enabled = tabControl1.TabPages.Count > 0 && EditLayer == GetCurrentLayer(); button4.Enabled = GetCurrentLayer() == _EditLayer; button2.Enabled = button4.Enabled; }