Change RadImageButtonElement image in controls collection

3 posts, 1 answers
  1. Filleau
    Filleau avatar
    114 posts
    Member since:
    Jun 2006

    Posted 12 Apr 2012 Link to this post

    Hi all,

    I have a RadStatusStrip control, with inside 10 RadImageButtonElement controls (named BC0, BC1,BC2,BC3 etc) and a array with images (named Img())

    How can I change the images of the RadImageButtonElement in a loop ?

    Something this :

    For I as Integer = 0 to 9 
          BC+i.tostring .image=img(i)
    next I

    I tryed to use :
        me.controls("BC"&i.tostring).image=img(i)   but it don't work !

    Thanks

  2. Filleau
    Filleau avatar
    114 posts
    Member since:
    Jun 2006

    Posted 12 Apr 2012 Link to this post

    I think I found by myself.

    But may be it is not the best....

    Dim control2 As RadImageButtonElement
    For i As Integer = 0 To 9
             control2 = RadStatusStrip1.Items(i)
             control2.Image = img(i)
    Next
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Answer
    Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 17 Apr 2012 Link to this post

    Hi Filleau,

    Thank you for writing.

    The approach used is a correct way to iterate and set the elements image.

    Let us know if you have any other questions.
     
    All the best,
    Stefan
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top