This is a migrated thread and some comments may be shown as answers.

Changing desktopalert color

7 Answers 323 Views
DesktopAlert
This is a migrated thread and some comments may be shown as answers.
Bhavin
Top achievements
Rank 1
Bhavin asked on 28 Oct 2011, 02:40 AM
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

 

 


7 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 01 Nov 2011, 12:28 PM
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.

0
Will
Top achievements
Rank 1
answered on 15 May 2013, 08:13 PM

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;

0
Stefan
Telerik team
answered on 20 May 2013, 10:40 AM
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 >>
0
Will
Top achievements
Rank 1
answered on 20 May 2013, 12:57 PM
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;
0
Stefan
Telerik team
answered on 20 May 2013, 12:59 PM
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?
0
Will
Top achievements
Rank 1
answered on 20 May 2013, 01:52 PM
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.
0
Stefan
Telerik team
answered on 22 May 2013, 10:25 AM
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?
Tags
DesktopAlert
Asked by
Bhavin
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Will
Top achievements
Rank 1
Share this question
or