Im currently building my first VB.net program. i have an array created in one form using the following code:
On another form i want to be able to clear the array when a button is pressed, i researched this and found that arrayname.clear() is what i need to use, so i thought the following would be what i want: (Note this is on another form to the code above)
It says GraphicsItem is not declared, i thought that because i had declared it as public on the first form it would be accessible, i guess im confused about the scope. i also tried formname.graphicsitems.clear() but that didnt work either. i have tried googling around but im not sure what im looking for so any help would be appriciated.
Thanks.
VB.NET:
[SIZE=2][COLOR=#0000ff]
Public[/COLOR][/SIZE][SIZE=2] GraphicsItems [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] ArrayList()
[/SIZE]
On another form i want to be able to clear the array when a button is pressed, i researched this and found that arrayname.clear() is what i need to use, so i thought the following would be what i want: (Note this is on another form to the code above)
VB.NET:
[SIZE=2][COLOR=#0000ff]
Private [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] ClearCanvasToolStripMenuItem_Click([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Object, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.EventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2] ClearCanvasToolStripMenuItem.Click
GraphicsItems.Clear()
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub
[/COLOR][/SIZE]
It says GraphicsItem is not declared, i thought that because i had declared it as public on the first form it would be accessible, i guess im confused about the scope. i also tried formname.graphicsitems.clear() but that didnt work either. i have tried googling around but im not sure what im looking for so any help would be appriciated.
Thanks.