Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 713463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:57:51+00:00 2026-05-14T04:57:51+00:00

I have a save as image feature for charts in my application. The chart

  • 0

I have a save as image feature for charts in my application. The chart control is a custom user control with custom logic in them. It also has some scaling based on size, zoom etc. However, while saving them as an image I would like to give the user the option to set the size of the image (eg: 800×600 px @ 300 DPI).

To do this I have created a Form with textboxes/checkboxes etc for various settings for image. One of these TextBoxes is for the file name. The file name textbox is readonly and is accompanied with a browse button which shows a SaveFileDialog when clicked.

The user clicks “Save As Image” in the main form’s menu. I show the ImageExportDialog using the code below:

using(ImageExportDialog dlg = new ImageExportDialog())
{
   if(dlg.ShowDialog() == DialogResult.OK)
   {
      //get the settings selected by the user and generate the image
   }
}

In the ImageExportDialog, the user clicks on the browse button and the SaveFileDialog is shown as follows:

using(SaveFileDialog dlg = new SaveFileDialog())
{
   if(dlg.ShowDialog() == DialogResult.OK)
   {
      txtFileName.Text = dlg.FileName;
   }
}

Now the problem is, when the user clicks on “Save” button in the SaveFileDialog, as expected the txtFileName.Text is set, but the parent custom dialog also seems to return from the ShowDialog method and the DialogResult is the same as the one for SaveFileDialog! The control then goes on to the “get the settings selected by the user and generate the image” part of the code above.

Not really sure what I am doing wrong here!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:57:52+00:00Added an answer on May 14, 2026 at 4:57 am

    Arghhh!!!

    Found out the issue myself. I had copy-pasted the OK button of the ImageExportDialog to create the Browse button for the SaveFileDialog.

    Guess what, the Browse button had it’s DialogResult property set to “OK”! Changing it to “None” solved the issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application has a photobooth feature which will allow the user to take a
I have written code in Java to access web cam,and to save image... I
Image Dummy = Image.FromFile(image.png); Dummy.Save(image.bmp, ImageFormat.Bmp); what the question says i have these using
We have repositories which have a Save method. They also throw a Created event
I am working on an app and i have to save some data in
On my screen there is an image and I have to save this image
I want to save image in iphone album and retrieve them on particular index,
I have used Photoshop CS2's Save for Web feature to create a table of
I have stored a few pictures using Safari's Hold + Save Image option to
Hi all i am trying to save image in the bundle which i have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.