سلام.
اگه بخوای که یک textBox فقط کاراکترهای 0 تا 9 و ~,*,/,+,- رو قبول کنه چه باید کرد.یه چیزی شبیه ماشین حساب ویندوز با یک کمی تفاوت.در ضمن برای تعریف کلیدهای ترکیبی توی یک فرم از چه راهی باید رفت.مثلا با زدن Ctrl+Alt+C فرم بسته شه.
ممنون
سلام.
اگه بخوای که یک textBox فقط کاراکترهای 0 تا 9 و ~,*,/,+,- رو قبول کنه چه باید کرد.یه چیزی شبیه ماشین حساب ویندوز با یک کمی تفاوت.در ضمن برای تعریف کلیدهای ترکیبی توی یک فرم از چه راهی باید رفت.مثلا با زدن Ctrl+Alt+C فرم بسته شه.
ممنون
Close your eyes, take a deep breath, click your heels three times, and say, "There's no better thing than Inversion of Control and Dependency Injection, generic specialization, the decorator pattern, chains of responsibilities, and extensible software."
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = (char.IsDigit(e.KeyChar) || char.IsControl(e.KeyChar)) ? false : true;
}
البته واسه کلید های کنترل و شیفت و ... باید از
e.Modifiers
استفاده کنی
ممنون.می شه یه ضمیمه پیوست کنید.ممنون می شم
Close your eyes, take a deep breath, click your heels three times, and say, "There's no better thing than Inversion of Control and Dependency Injection, generic specialization, the decorator pattern, chains of responsibilities, and extensible software."
واقعا ممنون می شم اگه یه نفر یه نمونه بذاره.اخه واسه پروژه پایان ترم ساختمان داده کارش دارم.
بازم ممنون
Close your eyes, take a deep breath, click your heels three times, and say, "There's no better thing than Inversion of Control and Dependency Injection, generic specialization, the decorator pattern, chains of responsibilities, and extensible software."