RadDesktopAlert doesn't show on Windows 7

1 Answer 93 Views
DesktopAlert
George C.
Top achievements
Rank 2
Iron
Veteran
George C. asked on 04 Jul 2021, 02:25 PM | edited on 04 Jul 2021, 02:25 PM

Greetings,

There seems to be an issue with the RadDesktopAlert on Windows 7.

The code below illustrates  how I create an instance of RadDesktopAlert  and setting its properties to my desired values :


Dim dskAlert As New RadDesktopAlert

Sub ShowAlert()

        dskAlert.ResetLocationModifier()
        dskAlert.IsPinned = True
        dskAlert.AutoClose = False
        dskAlert.CanMove = True
        dskAlert.Opacity = 1
        dskAlert.Popup.Parent = ME
        dskAlert.ThemeName = "VisualStudio2012Light"
        dskAlert.FadeAnimationFrames = 10
        dskAlert.FadeAnimationType = FadeAnimationType.FadeIn
        dskAlert.PopupAnimationFrames = 20
        dskAlert.PopupAnimationEasing = Telerik.WinControls.RadEasingType.InOutCubic
        dskAlert.PopupAnimationDirection = RadDirection.Down
        dskAlert.ShowCloseButton = True
        dskAlert.ContentText = "This is a test"
        dskAlert.RightToLeft = System.Windows.Forms.RightToLeft.No
        dskAlert.ScreenPosition = Telerik.WinControls.UI.AlertScreenPosition.Manual
        dskAlert.ShowOptionsButton = False
        dskAlert.ShowPinButton = False
        dskAlert.PlaySound = False
        dskAlert.AutoSize = True
        dskAlert.Popup.AlertElement.Font = New Font("Tahoma", 10, FontStyle.Regular)
        dskAlert.Popup.AlertElement.ContentElement.TextAlignment = ContentAlignment.MiddleCenter
        dskAlert.Popup.AlertElement.ForeColor = Color.Red
        dskAlert.Popup.AlertElement.ContentElement.Font = New Font("Tahoma", 10, FontStyle.Regular)
        AddHandler dskAlert.Popup.PopupOpening, AddressOf dskAlert_PopupOpening
        dskAlert.Show()

End Sub

  Private Sub dskAlert_PopupOpening(sender As Object, args As CancelEventArgs)
        Dim arg = TryCast(args, RadPopupOpeningEventArgs)
        arg.CustomLocation = New Point((Me.Width - dskAlert.Popup.Width) \ 2,
                         (Me.Height - dskAlert.Popup.Height) \ 2)
  End Sub

It works fine on my Windows 8.1, however, the RadDesktopAlert box doesn't show up on Windows 7 as I tested many times. After several attempts to find out what causes the issue, I found the code line below to be the cause :

dskAlert.Popup.Parent = ME

It seems that setting parent property of the popup property makes the popup box invisible. I preferred to write "INVISIBLE", because there seems to be an invisible from showing up in front of the main form and this makes all the controls of the main form UnClickable.

What's your opinion about this issue ?

 

 

 

1 Answer, 1 is accepted

Sort by
0
Stoyan
Telerik team
answered on 06 Jul 2021, 12:43 PM

Hello George,

After looking into your issue, I've found similar behavior on Windows 10. The issue is closely related to setting the Parent of the Popup.

RadDesktopAlert is generally used as desktop alert window and thus it calculates its location in desktop coordinates. Setting a Parent messes with this logic.

As for Windows 7 I can assume that the alert window is placed somewhere outside the Parent window and that's why you cannot see it. Since the alert window has a parent - it is blocking the parent until it is closed.

Another problem might be connected to the fact that different Windows versions use different versions of Desktop Window Manager (DWM). DWM works differently on Windows 7 and Windows 8. We set certain flags using the DWM and this might lead to different results. I will need further to investigate the issue on a Windows 7 machine. 

Keep in mind that RadDesktopAlert is designed to work on the Desktop and not on a particular window, so setting a Parent to the Popup is not recommended. Can you tell me, why do you need to set a Parent?

I can recommend to use the alert window without setting a parent. If there is anything else, do not hesitate to write back.

Regards,
Stoyan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
DesktopAlert
Asked by
George C.
Top achievements
Rank 2
Iron
Veteran
Answers by
Stoyan
Telerik team
Share this question
or