Carousel - Images

3 posts, 0 answers
  1. chaily pardes
    chaily pardes avatar
    6 posts
    Member since:
    Aug 2009

    Posted 18 Aug 2009 Link to this post

    Hi,
    We want to buy your product so we try it now to see if it's feet us.
    we want a carousel with images,The images will be added in runtime
    here is my code:
    --------------------------------------------------------------------------------------------------------------------------------------------

    RadButtonElement

     

    radB = new RadButtonElement();

     

     

     

    Image Image = SaveBitmap(f); //My Faunction which returns an image

     

    radB.CanFocus =

    true;

     

     

     

    radB.DisplayStyle = Telerik.WinControls.

     

     

    DisplayStyle.Image;

     

     

    radB.Image = Image;

    radB.Name =

    "radButtonElement";

     

     

     

    radB.Text =

    "radButtonElement";

     

     

     

    ((Telerik.WinControls.Primitives.

     

     

    FillPrimitive)(radB.GetChildAt(0))).Visibility = Telerik.WinControls.ElementVisibility.Hidden;

     

    ((Telerik.WinControls.Primitives.

     

    BorderPrimitive)(radB.GetChildAt(2))).Visibility = Telerik.WinControls.ElementVisibility.Hidden;

     

     

     

    this.leoSchachterCarousel1.Items.Add(radB);
    ---------------------------------------------------------------------------------------------------------------------------------------

    the Problem Is that the Image is to big and when I set it smaller it is cut...
    how can I set an AutoSize and Stretch Image to RadButtonElement ?
    Thank You,

     

     

  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 18 Aug 2009 Link to this post

    Hi chaily pardes,

    Thank you for writing.Yes, you can set the button element AutoSize to True -- in this case the button element size will be equal to the image size:

    radB.AutoSize = true

    Also, you can re-size images to proper sizes using this line of code:

    radB.Image = new Bitmap( SaveBitmap(f), 20,20);  

    I hope this helps. Don't hesitate to contact us if you have other questions.

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. chaily pardes
    chaily pardes avatar
    6 posts
    Member since:
    Aug 2009

    Posted 19 Aug 2009 Link to this post

    Perfect!!!
    Thank you
Back to Top