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

Change RadImageButtonElement image in controls collection

2 Answers 88 Views
StatusStrip
This is a migrated thread and some comments may be shown as answers.
Filleau
Top achievements
Rank 1
Filleau asked on 12 Apr 2012, 09:11 AM
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 Answers, 1 is accepted

Sort by
0
Filleau
Top achievements
Rank 1
answered on 12 Apr 2012, 10:01 AM
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
0
Accepted
Stefan
Telerik team
answered on 17 Apr 2012, 07:30 AM
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 >>
Tags
StatusStrip
Asked by
Filleau
Top achievements
Rank 1
Answers by
Filleau
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or