locked
Control Array with 22 image controls

    Question

  • Hello, I want to make an control array out of 22 image controls in Visual Basic language. I was struggling with different methods and am not sure how to proceed. The image controls are already on the form, just need the array to easily manipulate the properties of the controls in a control loop.

    Would any of this work? If not how would I make the statement?

    file: App.xaml.vb (phone app)

    NonInheritable Class App

        myimageArray() As Image Public Sub New()
            InitializeComponent
    ()
            myimageArray 
    = New Image() {Image1, Image2,}'And so on up to 22
       
    End Sub
    End Class

    Or simply This:

    InitializeComponent()

    Image [] myimageArray = new Image[22](); But in VB equivalent


    • Edited by JoeXX Tuesday, March 10, 2015 5:42 AM Mistake in file type, is xaml.vb
    Monday, March 09, 2015 9:41 PM

Answers

  • Thanks for the consideration. Anyway I wrote a statement that worked:

    Dim myImageArray() As Image = {clipView(), clipView1, clipView2, clipView3} 'on up to 22

    Probably other ways to do this but it works as intended for my phone app.

    If  I am in the wrong place, then

    1000 apologies.

    end if

    Tuesday, March 10, 2015 2:53 PM

All replies

  • Hi JoeXX,

    Are you working for Windows Store App, or you are developing a Windows Form application? If yes, I would move the question to Windows Form for a better support.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, March 10, 2015 2:31 AM
    Moderator
  • Hello, it is a phone app, xaml.vb. I got mixed up with my code. But keep in mind if I knew who to properly assign a control array, I guess I would not be asking.

    Thanks

    Tuesday, March 10, 2015 5:47 AM
  • Thanks for the consideration. Anyway I wrote a statement that worked:

    Dim myImageArray() As Image = {clipView(), clipView1, clipView2, clipView3} 'on up to 22

    Probably other ways to do this but it works as intended for my phone app.

    If  I am in the wrong place, then

    1000 apologies.

    end if

    Tuesday, March 10, 2015 2:53 PM
  • Hi JoeXX,

    Nice to see the shared solution.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, March 11, 2015 4:41 AM
    Moderator