These look fine. Can you show the Main() code where you create the Form
instances and try to set the properties?
--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net
"Sarah Smith" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
>
> intRecordNumber is the property I've added to a form - FrmMain - and
> I'm trying to make publicly available to other forms.
>
> Like this:
>
> Public Property intRecordNumber() As Integer
>
>
> nRecord is a form level variable in the form with the property which
> should be given a value in the property Set method:
>
> Set(ByVal Value As Integer)
> nRecord = Value
> Call DisplayRecord()
> End Set
>
> Here's the code again:
>
> Public Property intRecordNumber() As Integer
>
> Get
> intRecordNumber = intSelectedRow
> End Get
>
> Set(ByVal Value As Integer)
> nRecord = Value
> Call DisplayRecord()
> End Set
>
> End Property
>
> I'm used to VB6, so I'm not sure about "Shared" properties or
> variables ...
>
> SS.
>
> On Mon, 1 Mar 2004 08:46:42 -0500, "William Ryan eMVP"
> <(E-Mail Removed)> wrote:
>
> >Sarah:
> >
> >Are either intRecordNumber or nRecord declared as shared?
> >"Sarah Smith" <(E-Mail Removed)> wrote in message
> >news:(E-Mail Removed)...
> >> Hello,
> >>
> >> I've been trying to create a public property on one form that is
> >> "Setable" from another form.
> >>
> >> I have a Sub Main() which creates 2 public instances of the two forms
> >> that make up the project and then loads the first main form using
> >> ShowDialog.
> >>
> >> The menu on this form lets you display the second form.
> >>
> >> From the second form, I'd like to be able to set a property I've added
> >> to the first form and then close the second form.
> >>
> >> (This is a database detail/list view.)
> >>
> >> I have created the property in the first form like this:
> >>
> >> Public Property intRecordNumber() As Integer
> >>
> >> Get
> >> intRecordNumber = intSelectedRow
> >> End Get
> >>
> >> Set(ByVal Value As Integer)
> >> nRecord = Value
> >> Call DisplayRecord()
> >> End Set
> >>
> >> End Property
> >>
> >> VS complains that I am making a reference to a "non-shared member" but
> >> both frmMain and frmListView were declared publicly in the code module
> >> that contains Sub Main().
> >>
> >> Can anyone help??
> >>
> >> SS.
> >
>