Neil
Mon Feb 19 09:44:35 CST 2007
In the .NET world, a form is class. Therefore, you can do everything you do
with classes with forms too, including creating properties.
For example:
Imports System.Windows.Forms
Class MyForm
Inhertits Form
Dim m_someImportantData As String
Public Property SomeImportantData() As String
Get
Return m_someImportantData
End Get
Set(ByVal Value As String)
m_someImportantData = Value
End Set
End Property
End Class ' MyForm
Now you can pass data to MyForm by setting the MyForm.SomeImportantData
property like this:
Dim myFormInstance As New MyForm()
myFormInstance.SomeImportantData = "This data is really, really, REALLY
important. So there."
--Neil
--
Neil Cowburn
Principal Partner
OpenNETCF Consulting, LLC.
http://www.opennetcf.com/
"shawrie" <neil.shaw@sanderson.com> wrote in message
news:1171899004.996260.173140@k78g2000cwa.googlegroups.com...
> hi thankds for that have you got any simple examples of this?
>
> On 19 Feb, 14:56, "Neil Cowburn" <neilc@[nospamthanks].opennetcf.com>
> wrote:
>> This is OK if you plan on passing all the data when you construct the
>> form/class instance. Otherwise, you can create properties with
>> getters/setters so that you can modify the data within the form/class
>> after
>> instantiating it.
>>
>> --
>> Neil Cowburn
>> Principal Partner
>> OpenNETCF Consulting, LLC.
>>
>>
http://www.opennetcf.com/
>>
>> "shawrie" <neil.s...@sanderson.com> wrote in message
>>
>> news:1171894135.811413.138250@m58g2000cwm.googlegroups.com...
>>
>>
>>
>> > hopefully my last post for a while im currently passing a couple of
>> > variables between a number of forms. Im currently doing this my using
>> > the private sub new and overiding it. Is this ok or is there a better
>> > way of passing information between forms and classes- Hide quoted
>> > text -
>>
>> - Show quoted text -
>
>