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

Set Backcolor for Titlebar

3 Answers 53 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lawrence Antony Raj
Top achievements
Rank 1
Lawrence Antony Raj asked on 20 Jan 2009, 01:30 AM
Hi there,

I just started using Telerik RadControls for WinForms. I have crated a Shaped Form and tried setting the backcolor of the titlebar at runtime. Following is the code which sets the backcolor at runtime, but the color doesnt get effected.

this

.radTitleBar1.backcolor = Color.Blue;

 


Then, I tried using the following code to acheive the same.

((Telerik.WinControls.Primitives.FillPrimitive)(

this.radTitleBar1.GetChildAt(0).GetChildAt(0))).BackColor = Color.Blue;

 

((Telerik.WinControls.Primitives.FillPrimitive)(

this.radTitleBar1.GetChildAt(0).GetChildAt(0))).BackColor2 = Color.Blue;((Telerik.WinControls.Primitives.FillPrimitive)(this.radTitleBar1.GetChildAt(0).GetChildAt(0))).BackColor3 = Color.Blue;((Telerik.WinControls.Primitives.FillPrimitive)(this.radTitleBar1.GetChildAt(0).GetChildAt(0))).BackColor4 = Color.Blue;

 

Why the previous code didnt work?

Thanks
Raj

3 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 20 Jan 2009, 01:31 PM
Hi Lawrence Antony Raj,

Thanks for writing.

The first piece of code does not work because the BackColor property does not refer to the back color of the RadTitleBar. This was chosen in this way because you cannot control a four color gradient with only one property. The BackColor property is there simply because it is inherited from System.Windows.Forms.Control.

Here is a link to the Hierarchy Editor documentation. Using it, you can inspect the visual properties of the RadTitleBar and change them:

http://www.telerik.com/help/winforms/vsb_uielementhiearchyeditor.html

At runtime you will have to use the GetChildAt() method.

I hope this was a helpful answer. Please write again if you have other difficulties or questions.

Greetings,
Victor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Lawrence Antony Raj
Top achievements
Rank 1
answered on 21 Jan 2009, 12:42 AM
Hi there,

Thanks for your reply.

I wanted to implement Mousehover for Raddatagridview.  What are the events that needs to be implemented.

On Another note, I have created a form with various controls and then setting those control properties at runtime. When I execute the application, it take around 20-30 seconds for form to come up. So, I have implemented a Splash Form to cover up the loading time. Is there anyway I can speed up and reduce the loading time of the form or is it an expected behaviour?

Thanks,
Raj
0
Victor
Telerik team
answered on 21 Jan 2009, 11:01 AM
Hi Lawrence Antony Raj,

You are welcome.

You need not do anything besides subscribing to MouseHover event. However, how do you want to use the MouseHover? Please describe your scenario in more details so that we will be able to answer your question more thoroughly.

Now about your Form question. Are you loading your data from a database, a web service, or are you performing other time consuming task? There is no reason for our controls to be causing such a behavior. You can submit a support ticket where you will be able to attach files and send us a sample application to debug.

Greetings,
Victor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Lawrence Antony Raj
Top achievements
Rank 1
Answers by
Victor
Telerik team
Lawrence Antony Raj
Top achievements
Rank 1
Share this question
or