如何在c#中为AlertControl Dexpress添加保证金

时间:2014-08-15 20:43:36

标签: c# devexpress

如何在显示时以编程方式在alertcontrol表单上添加边距。 iv'e试过这个事件BeforeFormShow但似乎没什么变化。

这就是我所做的。

private void alertControl1_BeforeFormShow(object sender,
        DevExpress.XtraBars.Alerter.AlertFormEventArgs e)
    {
        e.AlertForm.Location = new Point(500, 500);
        e.AlertForm.OpacityLevel = 1;

    }

PS:FormLocation:TopRight

1 个答案:

答案 0 :(得分:1)

不太明确您的确切余量,但要控制AlertForm的位置,您应该使用允许手动指定警报窗口位置的AlertFormEventArgs.Location属性。 /> 所以,只需按如下方式更改代码:

void alertControl1_BeforeFormShow(object sender, DevExpress.XtraBars.Alerter.AlertFormEventArgs e) {
    e.Location = new Point(500, 500);
}