Passing Read-Only Arrays

wfunction

Well-known member
Joined
Oct 31, 2006
Messages
46
Programming Experience
1-3
I wanted to know how to pass a read-only copy of an array, where neither the array nor the CONTENTS can be changed.

For example, if I say:
VB.NET:
Dim t() as TextBox = New TextBox() {...}
and use the Array.AsReadOnly() to pass it as readonly, then all they nead to do is (assuming the passed array is p()):
VB.NET:
p(0).Text = "Text Cleared in a ReadOnly Array!!!"

How do I prevent this?
 
Back
Top