Hi all! I've been having no luck at all the past few months triggering an event within my parent form, from my child form...
Allow me to elaborate...
I have a function that loads some dabase info into a list view:
I then have a button on my form that allows me to add a new photo via a child form:Code:public void photologload() { OleDbConnection Myconnection = null; OleDbDataReader dbReader = null; Myconnection = new OleDbConnection (@"Provider=Microsoft.Jet.OLEDB.4.0; User Id=; Password=; Data Source=ghostphotos.mdb"); Myconnection.Open(); OleDbCommand cmd = Myconnection.CreateCommand(); cmd.CommandText = "SELECT * FROM photos"; dbReader = cmd.ExecuteReader(); int ida; while(dbReader.Read()) { ida = (int)dbReader.GetValue(0); nameofphoto = (string)dbReader.GetValue(1); photodescription = (string)dbReader.GetValue(2); pathtophoto = (string)dbReader.GetValue(3); datetaken = (string)dbReader.GetValue(4); photosummary = (string)dbReader.GetValue(5); //populate the log box ListViewItem lvItem = photoview.Items.Add(datetaken); lvItem.Tag = ida; lvItem.SubItems.Add(nameofphoto); lvItem.SubItems.Add(photodescription); } dbReader.Close(); Myconnection.Close(); }
What I want to do is, when I close the child form, I want the photoloadlog event to occur. I've tried passing variables, checking states of the child, etc, and nothign seems to get it to work correctly.Code:private void newphoto_Click(object sender, System.EventArgs e) { photoadd newphoto = new photoadd(); newphoto.Show(); }
Any insight into this one would be greatly appreciated!!!




Reply With Quote