Está en la página 1de 4

Me.UltraDesktopAlert1.AnimationStyleShow = AnimationStyle.Scroll Me.UltraDesktopAlert1.AnimationScrollDirectionShow = _ AnimationScrollDirection.

RightToLeft ' Force the desktop alert window to scroll from the left to ' the right as it automatically closes. Me.UltraDesktopAlert1.AnimationStyleAutoClose = AnimationStyle.Scroll Me.UltraDesktopAlert1.AnimationScrollDirectionAutoClose = _ AnimationScrollDirection.LeftToRight ' Time in milliseconds before the desktop alert window ' automatically closes. Me.UltraDesktopAlert1.AutoCloseDelay = 3000 ' This speeds up the scroll speed. Me.UltraDesktopAlert1.AnimationSpeed = AnimationSpeed.Fast ' This causes the desktop alert window to be fully opaque. Me.UltraDesktopAlert1.Opacity = 1 ' Display the desktop alert window with some sample text. Me.UltraDesktopAlert1.Show("Test Alert", "This is only a test.") -------------------------------------------------------------------------' Add five new tools to WinToolbarManager's tools collection. Me.UltraToolbarsManager1.Tools.AddRange(New ToolBase() _ { _ New ButtonTool("OpenAppointment"), _ New ButtonTool("SnoozeAppointment"), _ New ButtonTool("DismissAppointment"), _ New ButtonTool("DisableAlert"), _ New ButtonTool("DesktopAlertSettings") _ }) ' Set captions for all the tools. Me.UltraToolbarsManager1.Tools("OpenAppointment").SharedProps.Caption = _ "Open Appointment" Me.UltraToolbarsManager1.Tools("SnoozeAppointment").SharedProps.Caption = _ "Snooze for 15 minutes" Me.UltraToolbarsManager1.Tools("DismissAppointment").SharedProps.Caption = _ "Dismiss Appointment" Me.UltraToolbarsManager1.Tools("DisableAlert").SharedProps.Caption = _ "Disable Reminder Desktop Alert" Me.UltraToolbarsManager1.Tools("DesktopAlertSettings").SharedProps.Caption = _ "Desktop Alert Settings..." ' Create the popup menu. Dim menu As PopupMenuTool = New PopupMenuTool("PopupMenu1") ' Add the popup menu to the tools collection. Me.UltraToolbarsManager1.Tools.Add(menu) ' Add the menu items to the menu's tools collection. menu.Tools.AddToolRange(New String() _ { _ "OpenAppointment", _ "SnoozeAppointment", _ "DismissAppointment", _ "DisableAlert", _ "DesktopAlertSettings" _ }) ' Add separator lines above the following menu items. menu.Tools("SnoozeAppointment").InstanceProps.IsFirstInGroup = True

menu.Tools("DisableAlert").InstanceProps.IsFirstInGroup = True menu.Tools("DesktopAlertSettings").InstanceProps.IsFirstInGroup = True ' Set images for Snooze and Dismiss tools. menu.Tools("SnoozeAppointment").CustomizedImage = _ New Bitmap(Application.StartupPath + "\Snooze.gif") menu.Tools("DismissAppointment").CustomizedImage = _ New Bitmap(Application.StartupPath + "\Dismiss.gif") ' Add a handler for WinToolbarManager's ToolClick event. AddHandler UltraToolbarsManager1.ToolClick, _ AddressOf UltraToolbarsManager1_ToolClick ' Add a handler for WinDesktopAlert's DropDownButtonClicked event. AddHandler UltraDesktopAlert1.DropDownButtonClicked, _ AddressOf UltraDesktopAlert1_DropDownButtonClicked ' Make the Drop-down button visible so the end user can ' click it and get the popup menu. Me.UltraDesktopAlert1.DropDownButtonVisible = DefaultableBoolean.True -------------------------------------------------------------------In Visual Basic: Private Sub UltraToolbarsManager1_ToolClick _ (ByVal sender As System.Object, ByVal e As ToolClickEventArgs) _ Handles UltraToolbarsManager1.ToolClick End Sub ' Get a reference to the Appointment object. Dim menuAppointment As Appointment = Me.windowInfo.Data Select Case e.Tool.Key Case "OpenAppointment" Me.UltraCalendarInfo1.DisplayAppointmentDialog(menuAppointment) Case "SnoozeAppointment" menuAppointment.Reminder.Snooze(SnoozeIntervalUnits.Minutes, 15) MessageBox.Show("Reminder snoozed for 15 minutes") Case "DismissAppointment" menuAppointment.Reminder.Enabled = False MessageBox.Show("You will not be reminded about " + _ menuAppointment.Subject + " again.") Case "DisableAlert" MessageBox.Show("Reminder Desktop Alert disabled") Case "DesktopAlertSettings" MessageBox.Show("Desktop Alert Settings") End Select Private Sub UltraDesktopAlert1_DropDownButtonClicked _ (ByVal sender As System.Object, ByVal e As DropDownButtonClickedEventArgs) _ Handles UltraDesktopAlert1.DropDownButtonClicked ' Get a reference to the popup menu. Dim menu As PopupMenuTool = Me.UltraToolbarsManager1.Tools("PopupMenu1") ' Display the popup menu. Menu.ShowPopup(New Point(e.ButtonScreenRect.Left, _ e.ButtonScreenRect.Bottom), _ e.WindowInfo.DesktopAlertWindow) End Sub

------------------------------------------------------------------------------Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load Dim snoozeButton As UltraDesktopAlertButton = New UltraDesktopAlertButto n() Dim dismissButton As UltraDesktopAlertButton = New UltraDesktopAlertButt on() snoozeButton.Key = "SnoozeButton" dismissButton.Key = "DismissButton" snoozeButton.Appearance.Image = _ New Bitmap(Application.StartupPath + "\Snooze.gif") dismissButton.Appearance.Image = _ New Bitmap(Application.StartupPath + "\Dismiss.gif") Me.UltraDesktopAlert1.AlertButtons.AddRange(New UltraDesktopAlertButton( ) _ {snoozeButton, dismissButton}) AddHandler UltraDesktopAlert1.AlertButtonClicked, _ AddressOf UltraDesktopAlert1_AlertButtonClicked End Sub Private Sub UltraDesktopAlert1_AlertButtonClicked _ (ByVal sender As System.Object, ByVal e As AlertButtonClickedEventArgs) _ Handles UltraDesktopAlert1.AlertButtonClicked Dim alertButtonAppt As Appointment = e.WindowInfo.Data Select Case e.Button.Key Case "SnoozeButton" alertButtonAppt.Reminder.Snooze( _ SnoozeIntervalUnits.Minutes, 15) MessageBox.Show( _ "You will be reminded again in 15 minutes.") Case "DismissButton" alertButtonAppt.Reminder.Enabled = False MessageBox.Show("You will not be reminded about " + _ alertButtonAppt.Subject + " again.") End Select End Sub ---------------------------Me.UltraDesktopAlert1.FixedSize = _ New Size(Screen.PrimaryScreen.WorkingArea.Width / 2, _ Screen.PrimaryScreen.WorkingArea.Height / 2) ' Display the desktop alert window with some sample text. Me.UltraDesktopAlert1.Show("Test Alert", "This is only a test") -------------------------------------------------------------------' Create a new desktop alert window with some sample text. Dim windowInfo As UltraDesktopAlertShowWindowInfo = _ New UltraDesktopAlertShowWindowInfo("Test Alert", "This is only a test.") ' Pin the window to the screen so it does not auto close.

windowInfo.Pinned = True ' Show the Pin button so the end user can unpin the ' desktop alert window themselves. windowInfo.PinButtonVisible = True ' Display the desktop alert window using the information above. Me.UltraDesktopAlert1.Show(windowInfo)

' Create a new UltraDesktopAlertShowWindowInfo instance ' and give it some sample text. Dim windowInfo As UltraDesktopAlertShowWindowInfo = _ New UltraDesktopAlertShowWindowInfo("Test Alert", "This is only a test.") ' Set the screen that the alert window will appear on. ' AllScreens is an array of all screens attached to ' your system. If you have two monitors, 0 represents ' the primary screen and 1 represents the secondary ' and so on. windowInfo.Screen = Screen.AllScreens(1) ' Display the desktop alert window with the information above. Me.UltraDesktopAlert1.Show(windowInfo)

' Create a new desktop alert window with some sample text. Dim windowInfo1 As UltraDesktopAlertShowWindowInfo = _ New UltraDesktopAlertShowWindowInfo("Test Alert", "This is only a test.") ' Turn off screen positioning so you can set the ' position manually. windowInfo1.ScreenPosition = ScreenPosition.Manual ' Set the location of the desktop alert window to a ' location 200 pixels down and 200 pixels to the right ' of the upper-left corner of the screen. windowInfo1.ScreenLocation = New Point(200, 200) ' Display the desktop alert window using the information above. Me.UltraDesktopAlert1.Show(windowInfo1)

Me.UltraDesktopAlert1.Show("Sharing Violation", _ "Another user is currently using the same file. " + _ "You will not be able to save your work!") --------------------------------------------------------------------------Imports Infragistics.Win.Misc ' Create a new instance of the UltraDesktopAlertShowWindoInfo ' class and supply it with some sample text. Dim windowInfo As UltraDesktopAlertShowWindowInfo = _ New UltraDesktopAlertShowWindowInfo("Test Alert", "This is only a test.") ' Set the Sound property to a WAV file place in the project's ' root folder. windowInfo.Sound = Application.StartupPath + "..\Windows XP Exclamation.wav" ' Display a desktop alert window with the information ' provided above. Me.UltraDesktopAlert1.Show(windowInfo)

También podría gustarte