Change Background on Bubblebar

9 posts, 0 answers
  1. Richard Thurgood
    Richard Thurgood avatar
    26 posts
    Member since:
    Nov 2007

    Posted 30 Jul 2008 Link to this post

    Love it, love it!  The bubble bar is fantastic.

    Now, how can I change the background?  I'd like it to simply be transparent so my [image] buttons appear as though they are on the page itself.

    Thanks guys! Great product!!!
  2. Peter
    Admin
    Peter avatar
    1159 posts

    Posted 31 Jul 2008 Link to this post

    Hello Richard Thurgood,

    Thank you for your interest in RadControls for Winforms.

    The Quick-Start Framework's (QSF) BubbleBar is a demo control that demonstrate the Telerik Presentation Framework (TPF) capabilities. As it is a demo, the API of this control is not fully developped.

    To change or switch off the Background you should access the background fill primitive using the following line:

    this.bubbleBar1.Element.Children[0].Visibility = Telerik.WinControls.ElementVisibility.Collapsed;

    You can easy change the background colors, gradient and other properties.

    ((FillPrimitive)this.bubbleBar1.Element.Children[0]).BackColor2 = Color.Red
    ...
    ((FillPrimitive)this.bubbleBar1.Element.Children[0]).NumberOfColors = ...


    The Children[1] is BubbleBar's BorderPrimitive - it is also easy to manage by following this pattern.

    To inspect and access element hierarchichy, you can use the RadSpy tool.

    Hope this helps.

    Best wishes,
    Peter
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. guy
    guy avatar
    4 posts
    Member since:
    Apr 2009

    Posted 28 Apr 2009 Link to this post

    Hi,
        I want to add RadLabel control below button. How i can do that? I am using C#, sample code will be appiriciated.
    Also
        How I can find out programatically which button has been clicked.

    Thank you

    Guy
  4. Peter
    Admin
    Peter avatar
    1159 posts

    Posted 29 Apr 2009 Link to this post

    Hello,

    Thank you for writing.

    You could use the button Text property instead of adding a label below the button (screenshot0 and 2).

    About the click event: Please, subscribe to the click event for each button individually and you will know which button was clicked (screenshot1 or code below):

     this.radButtonElement3.Click += new System.EventHandler(this.radButtonElement3_Click); 

    Refer to the attached project or this Code Library.

    Hope this helps. Do not hesitate to write me back if you have further questions.

    Kind regards,
    Peter
    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.
  5. guy
    guy avatar
    4 posts
    Member since:
    Apr 2009

    Posted 29 Apr 2009 Link to this post

    Thank you for quick response. Appriciate it.
    Is there any way to know what button is clicked in bubblebar_click event and not write individual element click event?
  6. Peter
    Admin
    Peter avatar
    1159 posts

    Posted 30 Apr 2009 Link to this post

    Hi,

    Thank you for getting back.

    You could subscribe all buttons to one Click event:

    this.radButtonElement1.Click += new System.EventHandler(this.radButtonElement_Click);  
    this.radButtonElement2.Click += new System.EventHandler(this.radButtonElement_Click);  
    this.radButtonElement3.Click += new System.EventHandler(this.radButtonElement_Click);  
    Then use the Sender argument of radButtonElement_Click to recognize by Button.Text property which button is press.
    private void radButtonElement16_Click(object sender, EventArgs e) 
            { 
                RadButtonElement clickedButton = sender as RadButtonElement; 
                if( clickedButton != null ) 
                { 
                    switch( clickedButton.Text ) 
                    { 
                        case "Button1"
                            break
                        case "Cancel"
                            break
                    } 
     
                } 
            } 

    Hope this helps.

    Greetings,
    Peter
    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.
  7. guy
    guy avatar
    4 posts
    Member since:
    Apr 2009

    Posted 30 Apr 2009 Link to this post

    Thank you very much!! Nice component.
  8. Alex S
    Alex S avatar
    1 posts
    Member since:
    Jul 2009

    Posted 03 Aug 2009 Link to this post

    Hello.
    I use the bubblebar control with image buttons on the transparent form. But each drawn button has a white border pixels ( not from the image file). This border disappears on mouse over but it is always present in normal button state. 
    Is it something with antialiasing? I tried to change SmoothingMode but nothing helps.
    Could you please help me to remove these white pixels?
    Thanks
  9. Peter
    Admin
    Peter avatar
    1159 posts

    Posted 04 Aug 2009 Link to this post

    Hello Alex S,

    Thank you for your interest in RadControls. It seems that you are using a very old trial version, so please download the latest one. There are a lot of improvements in it.

    As to your question, you can turn off the buttons border using the code snippet below:

    this.radButtonElement1.ShowBorder=false 

    or you can edit the button theme to avoid the button border.

    All the best,
    Peter
    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.
Back to Top