1 Replies - 1446 Views - Last Post: 07 June 2009 - 06:28 PM Rate Topic: -----

#1 weirddemon  Icon User is offline

  • D.I.C Head

Reputation: -2
  • View blog
  • Posts: 190
  • Joined: 05-January 09

Using an Array to navigate forms

Post icon  Posted 07 June 2009 - 01:51 PM

I'm starting to learn arrays, but I'm a little bit confused on how to call the data listed in them.

I have the following code in a module and was wondering how I call them in my forms. I was told to use a counter to keep track of where the User is in the code in order from them to navigate correctly. I'll be using Next and Previous buttons.

Public FormList() As Form = {frmMain, frmStartup, frmUninstaller, frmAutomation}
	Public CurrentForm As Integer = 0


Is This A Good Question/Topic? 0
  • +

Replies To: Using an Array to navigate forms

#2 Cookiesliyr  Icon User is offline

  • D.I.C Head

Reputation: 12
  • View blog
  • Posts: 136
  • Joined: 16-May 09

Re: Using an Array to navigate forms

Posted 07 June 2009 - 06:28 PM

will to be frank that's a funny way to put forms in array ... if u asks me at least.

will arrays my friend is a container which save same type of data in same place, by using the name of array and an index u can put and get the data in the arrays, for example

dim IntArray(10) as integer

IntArray(0) = 5			 ' to assign a value in the first index in the array
text1.text = IntArray(9) ' to retrieve the last value in our array (in this example i didn't put one yet)

will as u can see we declare an array of integers that hold 10 values of different integers from index 0 to 9, u can put any integer value by assign them into the array(index)

will, u can put the values of the array in the declaration command for example

dim IntArray(3) as integer
IntArray(0) = 1
IntArray(1) = 2
IntArray(2) = 3

can be done like this

dim IntArray() as integer = {1, 2 ,3 }

this will do the same as the previews code, it will declare the the array and the values at once, in ur code u have made an array by the name of FormList as form array, cause in vb.net forms are objects u can put them in an array and then u can deal with them from inside the array as any regular form


will hope u get the idea how arrays work
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1