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

change backcolor of a form

6 Answers 218 Views
ColorDialog
This is a migrated thread and some comments may be shown as answers.
appdev
Top achievements
Rank 1
appdev asked on 10 Feb 2009, 08:13 PM

 

Private Sub Login_Form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

 

 

Me.BackColor = Color.Silver

 

ThemeResolutionService.ApplicationThemeName =

"Aqua"

 

 

End Sub

the backcolor doesn't change. it stays white all the time. how do i do this? please hlep thank you

 

6 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 13 Feb 2009, 01:36 PM
Hello Duy,

Thank you for the question.

The background color of RadForm is governed by the ClientFillPrimitive. Please refer to the following code snippet:
        Me.BackColor = Color.Silver  
        Me.FormElement.ClientFillPrimitive.BackColor = Color.Silver  
        Me.FormElement.ClientFillPrimitive.NumberOfColors = 1  
        ThemeResolutionService.ApplicationThemeName = "Aqua" 

Note that I am setting the BackColor property of the RadForm as well. This is in case that there are controls which do not have their BackColor property explicitly set. Since the BackColor is an ambient property, these controls will get the BackColor value of their parent, i.e. the RadForm.BackColor.

If you have additional questions, feel free to contact me.

Sincerely yours,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
kottu
Top achievements
Rank 1
answered on 21 Jul 2009, 04:27 AM
thanks Nikolay ,


regards,
 vicky


0
Alexandre
Top achievements
Rank 2
answered on 13 Sep 2009, 05:52 PM
Hi Nikolay, I'm a new user of Telerik, I bought the library a few days, I read the post and I'm follow ORM Tutorial and that there's a code to change color of RadForm like bellow:

this.FormElement.ClientFillPrimitive.BackColor =
Color.FromArgb(159, 159, 159);
this.FormElement.ClientFillPrimitive.BackColor2 =
Color.FromArgb(120, 120, 120);
this.FormElement.ClientFillPrimitive.BackColor3 =
Color.FromArgb(110, 110, 110);
this.FormElement.ClientFillPrimitive.GradientStyle =
GradientStyles.OfficeGlassRect;

but this don't compile, so reading the post i change the fist line to this.BackColor and work's fine, but how can I create the effect where can I find BackColor2 and BackColor3 ?

Thanks.



0
Deyan
Telerik team
answered on 14 Sep 2009, 07:30 AM
Hello Alexandre,

Thanks for contacting us and for your question. The code snippet that you found is not relevant to the latest version of RadControls for WinForms since the RadForm control has been rewritten from scratch and its element hierarchy has also been changed.

As you have already find out, you can change the background color of the form by using the BackColor property. However, if you would like to achieve a Gradient effect consisting of multiple colors, you could use a RadPanel control docked to fill the client area of the form. You can take a look at the following help article as a reference on how to build a gradient filled panel:

Creating a RadPanel with Gradient Background

After you have docked the panel to fill the client area of your form, you can drop your controls on it the same way as you would on a normal RadForm.

I hope this helps. Do not hesitate to write back if you need further assistance.

All the best,
Deyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Bruce
Top achievements
Rank 1
answered on 28 Feb 2011, 07:59 AM
RE: "The code snippet that you found is not relevant to the latest version of RadControls for WinForms since the RadForm control has been rewritten from scratch and its element hierarchy has also been changed."

Then please update the tutorial!  I'm trying to evaluate your product, and these repeated references to the tutorial not matching your latest release is a bit maddening.
0
Nikolay
Telerik team
answered on 28 Feb 2011, 08:28 AM
Hello Bruce,

Thank you for your feedback.

We are currently in the process of updating our step-by-step tutorial according to the API of the latest version of RadControls for WinForms. The updated tutorial will be released shortly after Q1 2010. Please accept our appologies for the inconvenience. For the time being, you can follow the RadForm articles from our online documentation.

Kind regards,
Nikolay
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
ColorDialog
Asked by
appdev
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
kottu
Top achievements
Rank 1
Alexandre
Top achievements
Rank 2
Deyan
Telerik team
Bruce
Top achievements
Rank 1
Share this question
or