System.IO.Directory.GetCurrentDirectory();
/////////////////////////
Application.StartupPath
System.IO.Path.GetDirectoryName( System.Reflection.Assembly.GetExecutingAssembly().Location)
AppDomain.CurrentDomain.BaseDirectory
System.IO.Directory.GetCurrentDirectory()
Environment.CurrentDirectory
System.IO.Path.GetDirectoryName( System.Reflection.Assembly.GetExecutingAssembly().GetName().Code Base)
System.IO.Path.GetDirectory(Application.ExecutablePath)
خیلی پیش میاد که شما یک فرم را از روی یک فرم دیگر(والد) باز می کنین و وقتی این اتفاق می افته فرم والد باید غیر فعال بشه .برای این کار از کدهای زیر استفاده کنید:
in form1:
form2 frm = new form2();
frm.show(this);
form2_Load()
{
if (this.owner != null)
this.owner.enabled = false
{
from2_formclosed()
{
if (this.owner != null)
this.owner.enabled = true;
}
برای اینکه فرم ویندوزی خود را فیکس کنید یعنی کاربر اجازه تغییر سایز آن را نداشته باشد کد زیر را در قسمت FormLoad بنویسید
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;