Hi,
This might get you started...
using System.Windows.Forms;
class Parent : Form
{
private Child childRef;
private void menuProperties_Click(object sender, EventArgs e)
{
if(childRef == null)
childRef = new Child(this);
// get whatever item is selected
// itemReference = myListBox.SelectedItem
childRef.Show();
childRef.ShowProperties(itemReference);
}
public void NewItem(bool down)
{
if(down)
// set next item in the list as selected
else
// set previous item in the list as selected
// get the selected item
// itemReference = myListBox.SelectedItem
childRef.ShowProperties(itemReference);
}
}
class Child : Form
{
private Parent p;
public Child(Parent p)
{
this.p = p;
}
private void DownButton_Click(object sender, EventArgs e)
{
p.NewItem(true);
}
private void UpButton_Click(object sender, EventArgs e)
{
p.NewItem(false);
}
public void ShowProperties(Item i)
{
// get properties for i and display them
}
}

Signature
Happy Coding!
Morten Wennevik [C# MVP]
Ignacio Estrada - 19 Feb 2005 22:58 GMT
Man, I forget to say you I am using VB instead of C# and I can not do the
translation to VB. So please could you write this sample on VB for me ?
Morten Wennevik - 21 Feb 2005 10:26 GMT
Sorry,
My VB is too bad for me to dare write it in public :(
The basic algoritm is to ...
1) Create a Parent class and a Child class.
2) Create a Child constructor that accepts a Parent as an argument
3) In the Parent class create a public method for changing selected item
(NewItem)
4) When you need to see the properties, create a Child object using the
overloaded constructor (new Child(this)). Store the reference to this
Child for later use. Call on the Child to show properties for the
selected item (pass an item reference).
5) When in the Child you need to change the selected item, call the Parent
(NewItem). The parent will then call Child with a reference to the new
item.
You may also check if the child reference is valid on SelectedIndexChanged
for the ListBox, if it is not null this means the properties dialog is
open and call the child to show properties.
> Man, I forget to say you I am using VB instead of C# and I can not do the
> translation to VB. So please could you write this sample on VB for me ?

Signature
Happy Coding!
Morten Wennevik [C# MVP]
Ignacio Estrada - 22 Feb 2005 06:28 GMT
All rigth, I will try to translate to VB and I will contact you later on.
I apprecciate so much your help !!
GrkEngineer - 21 Apr 2005 19:21 GMT
Morten,
I'm trying to do this same thing, but I am using c++ and header files. When
I try to create a Parent member in my child form it says it doesn't know what
it is. I think because I have each file calling each other and the headers
are getting confused. Only the first class recognizes the second. But the
second doesn't recognize the first. Please help.
> Hi,
>
[quoted text clipped - 56 lines]
>
> }