using namespace System.Windows.Forms;
using(var od = new OpenFileDialog())
{
if (od.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
// TO DO something futher
}
}
------------------------
using namespace System.Windows.Forms;
if((new OpenFileDialog()).ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
// Reference to anonymous ShowDialog out of scope
}
}
using(var od = new OpenFileDialog())
{
if (od.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
// TO DO something futher
}
}
------------------------
using namespace System.Windows.Forms;
if((new OpenFileDialog()).ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
// Reference to anonymous ShowDialog out of scope
}
}
No comments:
Post a Comment