void BeforeAlertDisplayed(object sender, EventArgs e) { DesktopAlertWindow win = (DesktopAlertWindow)sender; // This is how to set custom colors when needed or do anything else // win.BackColor=Color.Red; //win.ForeColor=Color.Yellow; }
private void ShowNotifyAlertWindow() { using (SpareEntities db = EntitiesFactory.CreateSpareInstance()) { var list = NotifyController.GetNewList(db, GlobalVar.NotifytypeList); if (list.Count == 0) { return; } list = list.Where(p => p.State == (int)BillState.New).ToList(); if (list.Count == 0) { return; } lblNotify.Text = $"待处理提示数量:{list.Count}"; lblNotify.Visible = true; try { var alertWindow = new DesktopAlertWindow { CloseButtonVisible = true, AlertPosition = eAlertPosition.BottomRight, BackColor = Color.DarkOrange, ForeColor = Color.White, Symbol = "\uf005", SymbolColor = Color.White, AutoCloseTimeOut = 60, Text = $"您有 {list.Count} 个待处理的提示信息,点击查看...", AlertId = 0 }; alertWindow.Click += AlertWindow_Click; alertWindow.Show(); } catch (Exception ex) { MessageHelper.ShowError(ex); } } }