您好,请参考下面的代码,将其放到点击按钮按下的事件中去:
double inch = 720.0;
AnnTextObject text = new AnnTextObject();
text.Stroke = null;
text.Text = "Test";
text.Font = new AnnFont("Arial", 10.0);
text.Fill = null;
text.Rect = LeadRectD.Create(3 * inch, 3 * inch, 1 * inch, 1 * inch);
Automation.Container.Children.Add(text);
Automation.Invalidate(LeadRectD.Empty);
Automation.SelectObject(text); |