|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DataNavigator AddNew problem(it's a car restoration database). This form has a DataNavigator, and it also has a GroupBox which has controls to allow the user to add images to the database. This groupbox also has a datanavigator. It all seems to work fine, except for as minor problem adding images. I use the following code to add a new image to the bound PictureBox: private void bindingNavigatorAddNewItem1_Click(object sender, EventArgs e) { base.OnClick(e); if (openFileDialog.ShowDialog() == DialogResult.OK) { string filename = openFileDialog.FileName; if (filename.Length != 0) { try { imagePictureBox.Image = new Bitmap(filename); imagePictureBox.Show(); } catch { MessageBox.Show(String.Format("{0} is not a valid image file!", filename), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } This seems to work ok, but the image isn't added to the database until the addnew button is pressed again. I seem to be missing something. Thanks for any help. Mark Johnson Derby, UK } |
|||||||||||||||||||||||