Who's on first :-)
This can get confusing - I'll try to summarize.
1. User opens Form A
2. User clicks a button on Form A which opens Form B. (ShowDialog)
3. User selects an item from a treeview control in Form B
4. User closes Form B.
5. When Form B closes, I want the Form A property updated with the value (integer) of the item selected from the treeview control in Form B(step 3).
So, the question, is - what is the best way to update the property on Form A, when the user closes Form B (which incidentally, returns the focus back to form A)
Al
>
>>Yes, Form A does exist. In fact, Form A opens Form B. I'll try it with a Shared property.<>
>Hmmm ... you shouldn't have to use a shared property. Oh wait ... are you trying to set the Form A property *from* Form B? Why? It should be set in Form A from a value in Form B. Since you're using .ShowDialog(), Form B still exists and you should be able to access it's properties from Form A.
>
>~~Bonnie
>
>
>
>>Hi Bonnie,
>>
>>Yes, Form A does exist. In fact, Form A opens Form B. I'll try it with a Shared property.
>>
>>Thanks, Al
>>
>>>Does Form A exist at this point? Is Form B called from Form A or from somewhere else? If Form A doesn't exist, perhaps what you need is a static property, rather than just a public one. I guess in VB they call it a shared property.
>>>
>>>~~Bonnie
>>>
>>>>Hi,
>>>>
>>>>This is probably very easy - but I'm having a brain dead kind of day.
>>>>
>>>>In my app I have two MDI Child forms - Form A and Form B.
>>>>
>>>>In Form A, I have a WriteOnly Property:
>>>>
>>>>
>>>>Public WriteOnly Property propDocID() As Integer
>>>> Set(ByVal Value As Integer)
>>>> mintDocID = Value
>>>> End Set
>>>>End Property
>>>>
>>>>
>>>>I call Form B which gives the user the ability to select an item from a small form that has a treeview control. I want to return an integer from Form B to set property 'propDocID' in Form A.
>>>>
>>>>This code calls Form B:
>>>>
>>>>
>>>>Dim frmSelect As New frmOpenTemplate
>>>>frmSelect.ShowDialog() 'want to show this form modally
>>>>
>>>>
>>>>In Form B (frmSelect in this example), I try to set the property 'propDocID' in form A - but this property doesn't appear to be available. (i.e. it doesn't appear in the intellesense listing of Form A properties).
>>>>
>>>>Can someome please point me in the right direction here ...
Al Williams
Anola MB, CANADA