public DrawFrame(DesignPanel tD, int width, int height, Image backImage) { TDPanel = tD; this.SetStyle(ControlStyles.Selectable, true); InitializeComponent(); this.BackColor = Color.FromArgb(192, 192, 192); this.SetStyle(ControlStyles.Selectable, true); this.AutoScroll = false; this.Cursor = Cursors.Arrow; DrawPanel = CreateDrawPanel(tD, width, height, backImage); DrawPanel.TabIndex = 0; DrawPanel.Select(); DrawPanel.BackColor = Color.White; this.Controls.Add(DrawPanel); this.SetLocation(); //事件初始化 this.SizeChanged += new EventHandler(DrawFrame_SizeChanged); this.DfVScrollBar.ValueChanged += new EventHandler(DfVScrollBar_ValueChanged); this.DfHScrollBar.ValueChanged += new EventHandler(DfHScrollBar_ValueChanged); this.DfVScrollBar.SmallChange = 10; this.DfHScrollBar.SmallChange = 10; }
/// <summary> /// 载入模板数据 /// </summary> /// <param name="tmpltID"></param> public void LoadTmplt(TmpltXmlDocument doc) { try { HasContentSnip = bool.Parse(doc.DocumentElement.GetAttribute("hasContent")); } catch (Exception) { HasContentSnip = false; } LoadLines(doc); LoadRects(doc); //DrawPanel.TmpltDoc = doc; ((TmpltDrawPanel)DrawPanel).TmpltDoc = doc; TmpltDoc = doc; DrawPanel.Invalidate(); }