Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
75
showing SaveFileDialog from context menu
posted

If you try to show a save file dialog from the menu item click event, you get an error that the dialog must be user instantiated.  The user selected menu item so it was user initiated.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

private

 

 

void saveAsMenuItem_Click(object sender, EventArgs  e)

{

 

 

 

 

 

 

SaveFileDialog dialog = new SaveFileDialog();

 

 

 

bool? dialogResult = dialog.ShowDialog();  //error is thrown here

 

 

 

 

if(dialogResult.HasValue && dialogResult.Value)

{

 

}

}

 

 

Parents
No Data
Reply Children
No Data