Professional Documents
Culture Documents
Main Form
Main Form
using System.Windows.Forms;
namespace EmbedAutoCAD
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
dlg.Filter =
"DWG files (*.dwg)|*.dwg|All files (*.*)|*.*";
Cursor oc = Cursor;
String fn = "";
if (dlg.ShowDialog() ==
DialogResult.OK)
{
Cursor = Cursors.WaitCursor;
fn = dlg.FileName;
Refresh();
}
if (fn != "")
this.drawingPath.Text = fn;
Cursor = oc;
}
private void loadButton_Click(
object sender, EventArgs e)
{
if (System.IO.File.Exists(drawingPath.Text))
axAcCtrl1.Src = drawingPath.Text;
else
MessageBox.Show("File does not exist");
}