您可以通过在 Format 事件中设置控件的属性来打开边框。例如,如果你想在文本框的值小于零时设置它的边框,你可以使用类似下面的代码:
private void detail_Format(object sender, System.EventArgs eArgs)
{
if (this.TextBox1.Value < 0) {
this.TextBox1.Border.BottomColor = System.Drawing.Color.Blue;
this.TextBox1.Border.BottomStyle = BorderLineStyle.DashDot;
this.TextBox1.Border.LeftColor = System.Drawing.Color.Blue;
this.TextBox1.Border.LeftStyle = BorderLineStyle.DashDot;
this.TextBox1.Border.RightColor = System.Drawing.Color.Blue;
this.TextBox1.Border.RightStyle = BorderLineStyle.DashDot;
this.TextBox1.Border.TopColor = System.Drawing.Color.Blue;
this.TextBox1.Border.TopStyle = BorderLineStyle.DashDot;
}
}
阅读此处了解有关边界属性的更多信息。
在结果页面上获取控件的位置并不容易。你可以根据一些东西来计算位置,但我建议使用控件本身来突出显示你想要的数据,而不是在页面上绘制。它会让你的生活更轻松:)
If a circle shape is important for you, you could use the "Shape" control in ActiveReports to do this by setting it's position and visibility based on a condition. Just make sure the shape's z-order is under the textboxes. The code to use a shape would be similar to how I structured the code above, but you would set the Top/Left/Width/Height and the Visible property of the shape control instead of setting border properties. More information on the shape control is here.
Hope this helps.
Scott Willeke
GrapeCity