Changing desktopalert color

8 posts, 0 answers
  1. Bhavin
    Bhavin avatar
    1 posts
    Member since:
    May 2011

    Posted 27 Oct 2011 Link to this post

    Hi there,

    I am trying to change the color of the desktopalert and its not working...can u pls let me know if its possible?

    i tried to change the color by theme, i.e.

    DesktopAlertQuickNote.ThemeName = "Windows7"

    thx

     

     


  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 01 Nov 2011 Link to this post

    Hello Bhavin,

    Thank you for writing.

    Please refer to the attached project, where I have implemented the desired functionality for you. There are three cases in this project:
    • Show alert with the default theme
    • Show alert with Windows7 theme
    • Show customized alert

    Let me know if you have any additional questions.
     
    Regards,
    Stefan
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Will
    Will avatar
    11 posts
    Member since:
    Apr 2013

    Posted 15 May 2013 Link to this post

    Your example is helpful in modifying the BackColor and the Caption grip bar, but what about the text and the buttons.

    I was able to modify the text as follows:

        alert.Popup.AlertElement.CaptionElement.TextAndButtonsElement.ForeColor = Color.White;
       alert.Popup.AlertElement.ContentElement.ForeColor = Color.White;

    ... but I can't figure out how to change the color of the buttons.  I tried this, but it had no effect:

        alert.Popup.AlertElement.CaptionElement.TextAndButtonsElement.PinButton.ForeColor = Color.White;

  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 20 May 2013 Link to this post

    Hi Will,

    Thank you for writing.

    Here is how to change the BackColor of the three buttons in RadDesktopAlert:
    radDesktopAlert1.Popup.AlertElement.CaptionElement.TextAndButtonsElement.PinButton.ButtonFillElement.BackColor = Color.Red;
    radDesktopAlert1.Popup.AlertElement.CaptionElement.TextAndButtonsElement.PinButton.ButtonFillElement.GradientStyle = GradientStyles.Solid;
     
    radDesktopAlert1.Popup.AlertElement.CaptionElement.TextAndButtonsElement.CloseButton.ButtonFillElement.BackColor = Color.Red;
    radDesktopAlert1.Popup.AlertElement.CaptionElement.TextAndButtonsElement.CloseButton.ButtonFillElement.GradientStyle = GradientStyles.Solid;
     
    radDesktopAlert1.Popup.AlertElement.CaptionElement.TextAndButtonsElement.OptionsButton.ActionButton.ButtonFillElement.BackColor = Color.Red;
    radDesktopAlert1.Popup.AlertElement.CaptionElement.TextAndButtonsElement.OptionsButton.ActionButton.ButtonFillElement.GradientStyle = GradientStyles.Solid;

    I hope that you find this useful.
     
    Regards,
    Stefan
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  6. Will
    Will avatar
    11 posts
    Member since:
    Apr 2013

    Posted 20 May 2013 Link to this post

    Thanks Stefan, but I need to change the actual color of the image.  In other words, for the Pin button, I want the pin to be a different color.  Right now, it's dark navy blue, which isn't attractive (or legible) on a red background.  Here are some lines, where I'm trying to make the PinButton black on a yellow background.  The first two lines have no effect.

    I've tried all of these lines, but nothing's working:
    myAlert.Popup.AlertElement.CaptionElement.TextAndButtonsElement.PinButton.BackColor = Color.Black;             
    myAlert.Popup.AlertElement.CaptionElement.TextAndButtonsElement.PinButton.ButtonFillElement.ForeColor = Color.Black;             
    myAlert.Popup.AlertElement.CaptionElement.TextAndButtonsElement.PinButton.ButtonFillElement.BackColor = Color.Yellow;             
    myAlert.Popup.AlertElement.CaptionElement.TextAndButtonsElement.PinButton.ButtonFillElement.GradientStyle = GradientStyles.Solid;
  7. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 20 May 2013 Link to this post

    Hi Will,

    You cannot do that by setting a color setting. You have to create an image with the desired colors and assign the image to the Image property of the desired button.
     
    All the best,
    Stefan
    the Telerik team
    RadChart for WinForms is obsolete. Now what?
  8. Will
    Will avatar
    11 posts
    Member since:
    Apr 2013

    Posted 20 May 2013 Link to this post

    I have seen the Pin show-up w/ different colors on different environments.  On a Windows7 workstation, the pin was white.  On a Windows Server 2008 R2 machine, the pin is dark-blue.  I know there is a way to change this.  If nothing else, it must just be pulling that color from one of the background elements, but I feel like I've changed everything possible.
  9. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 22 May 2013 Link to this post

    Hi Will,

    I am not sure how did you observe different color on the two machines as this is an image set to the button. Perhaps you were using different themes?

    Attached you can find the appearance of the desktop alert on both Windows 7 and Windows 2008 R2 machines.
     

    Regards,
    Stefan
    Telerik
    RadChart for WinForms is obsolete. Now what?
Back to Top
UI for WinForms is Visual Studio 2017 Ready