Note that there are some explanatory texts on larger screens.

plurals
  1. PO'Random_Number_File_Writer.Form1' does not contain a definition for 'saveFileDialog1_FileOk'
    primarykey
    data
    text
    <p><strong>'Random_Number_File_Writer.Form1' does not contain a definition for 'saveFileDialog1_FileOk' and no extension method 'saveFileDialog1)_FileOk' accepting a first argument of type 'Random_Number_File_Writer.Form1' could be found (are you missing a using directive or an assembly reference?)</strong></p> <p>That, is the error message that I am getting. I tried going to my college's lab for assistance, but the person is not familiar with C# and it took us around an hour just to get my line numbers showing (just for reference...) And then I went to my professor and he said he was going to be busy for a while.. So I thought I'd try here as an alternate source of help.</p> <p>I looked at the questions already on here regarding similar errors, but it still leaves me puzzled as how to correct this one in particular, and as I referenced the code in my textbook as closely as possible, I'm not sure I understand why I'm even getting this error. </p> <p>Here's the code, and I'm sorry if it's difficult to read. Oh, and I know that this is the part generating the error, because I had it running yesterday, WITHOUT this part. But part of the assignment is having the save as dialog.</p> <pre><code>try { //Initial opening point for save file dialogue saveFileDialog1.InitialDirectory = @"C:\Users\Heather\Documents\Visual Studio 2010\Projects\Random Number File Writer"; //Save As popup - Opening the file for writing usage once it's created. if(saveFileDialog1.ShowDialog() == DialogResult.OK) { randomNumberFile = File.CreateText(openFileDialog1.FileName); } else // Popup informing user that the data will not save to a file because they didn't save. { MessageBox.Show("You elected not to save your data."); } </code></pre> <p>here's the using stuff that didn't format:</p> <pre><code>using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; // Added to be able to use StreamWriter variable type </code></pre> <p>And here is the code snippet it gives when I double click and it takes me to the Form1.Designer.CS window.</p> <pre><code> this.saveFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.saveFileDialog1_FileOk); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload