LoadFromFile

Top  Previous  Next

public Boolean LoadFromFile(String fileName,String encoding)

 

Description:

 Load from a file.

 

Parameter:

 fileName: The file you want to load.

 

Return value:

 true: Load successfully

 false: Load unsuccessfully

 encoding: The coding of character

 

Example:

 private void menuFileOpen_Click(object sender, System.EventArgs e)

 {

         openFileDialog1.InitialDirectory = Application.StartupPath;

         openFileDialog1.Filter = "TCAD drawing file(*.tcad)|*.tcad";

         openFileDialog1.FilterIndex = 1;

         if (openFileDialog1.ShowDialog() == DialogResult.OK)

         

                 myCAD1.LoadFromFile(openFileDialog1.FileName,"gb2312");

                 EditingFileName = openFileDialog1.FileName;

                 AdjustCanvas();

         }

 }

 

See also:

 SaveToFile