الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كيف يمكن اختيار الحدث

مغلق
بدأه mimi في 23 يونيو 2002 · 3 رد · 833 مشاهدة · في Microsoft Visual C#.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

كيف اختار الحدث في السي #

مثل الحدث الرئيسي للزر هو click كيف اختار حدث اخر

#2

Hello Mimi,

There are many events for each object especially objects used in Windows and Web Forms.

To find all events for a class check the .NET SDK .For example the Button class has these events:

Button Class Events

now you need to specify the event handler.Event handler is the method which you want to be called or executed when the event happens.

to specify an event handler for the event Click of a button called Button1 you write :

Button1.Click += new System.EventHandler(ButtonClickHandler);

This will tell the run time environment that the method ButtonClickHandler must be called when the user clicks the button.

Now you can code the ButtonClickHandler:

private void ButtonClickHandler(object sender, System.EventArgs e)
		{
		put you code here
		}

Tahiyati

Madani

#3

هناك طريقة أسهل أخ mimi

أختر الزر أو الأداة التي تريد إضافة الحدث لها ثم في نافذة الخصائص اختر الزر Events ، فتظهر لك أحداث هذه الأداة ، انقر مرتين على الحدث الذي تريده فيظهر لك محرر الكود مع الحدث الجديد الذي أخترته

#4

مشكورين شباب وماتقصرون

هذا الموضوع مغلق.

مواضيع مشابهة