Should i use the SendMessage() method or anything else
Can anybody tell me how i can do it, please
thanks.
Smart Devices VB and C# Projects
Hi,
There are a number of possible ways to implement this depending upon your needs. One possible technique (if using modal dialogs) would be to expose the information you need to pass back via properties on your second form.
An outline of how that may look in code is as follows:
public class FormWithListView : Form
{
public void ShowDetailsForm()
{
DetailsForm f = new DetailsForm();
f.ShowDialog();
// You could replace this message box with something which
// altered your list view control
MessageBox.Show(f.ExampleValue, "Value from details form");
}
}
public class DetailsForm : Form
{
private void Done_Click(object sender, EventArgs e)
{
Close();
}
public string ExampleValue
{
get { return textBox1.Text; }
}
}
If you simply need access to a textbox or similiar control within the second form, you could also just set the "Modifiers" property of the control you want to access to "Public".
Hope this helps,
Christopher Fairbairn