Set Backcolor for Titlebar

4 posts, 0 answers
  1. Lawrence Antony Raj
    Lawrence Antony Raj avatar
    2 posts
    Member since:
    Nov 2008

    Posted 19 Jan 2009 Link to this post

    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

  2. Victor
    Admin
    Victor avatar
    1358 posts

    Posted 20 Jan 2009 Link to this post

    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.
  3. Lawrence Antony Raj
    Lawrence Antony Raj avatar
    2 posts
    Member since:
    Nov 2008

    Posted 20 Jan 2009 Link to this post

    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
  4. Victor
    Admin
    Victor avatar
    1358 posts

    Posted 21 Jan 2009 Link to this post

    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.
Back to Top