Thursday 2 December 2021

Dec-2019(9) Explain various dialog boxes with properties & methods.



There are many built-in dialog boxes to be used in Windows forms for various tasks like opening and saving files, printing a page, providing choices for colors, fonts, page setup, etc., to the user of an application. These built-in dialog boxes reduce the developer's time and workload.

विंडोज़ फॉर्म में कई बिल्ट-इन डायलॉग बॉक्स हैं जिनका उपयोग विभिन्न कार्यों जैसे फाइलों को खोलना और सहेजना, एक पेज को प्रिंट करना, किसी एप्लिकेशन के उपयोगकर्ता को रंग, फोंट, पेज सेटअप आदि के विकल्प प्रदान करना है। ये बिल्ट-इन डायलॉग बॉक्स डेवलपर के समय और कार्यभार को कम करते हैं

All of these dialog box control classes inherit from the CommonDialog class and override the RunDialog() function of the base class to create the specific dialog box.

ये सभी डायलॉग बॉक्स कंट्रोल क्लास CommonDialog क्लास से इनहेरिट करते हैं और विशिष्ट डायलॉग बॉक्स बनाने के लिए बेस क्लास के RunDialog()  फंक्शन को ओवरराइड करते हैं।

The RunDialog() function is automatically invoked when a user of a dialog box calls its ShowDialog() function.

RunDialog () फ़ंक्शन स्वचालित रूप से लागू होता है जब एक डायलॉग बॉक्स का उपयोगकर्ता अपने ShowDialog () फ़ंक्शन को कॉल करता है।



The ShowDialog method is used to display all the dialog box controls at run-time. It returns a value of the type of DialogResult enumeration. The values of Dialog Result enumeration are −

Abort − returns DialogResult.Abort value, when user clicks an Abort button.

Cancel − returns DialogResult.Cancel, when user clicks a Cancel button.

Ignore − returns DialogResult.Ignore, when user clicks an Ignore button.

No − returns DialogResult.No, when user clicks a No button.

None − returns nothing and the dialog box continues running.

OK − returns DialogResult.OK, when user clicks an OK button

Retry − returns DialogResult.Retry , when user clicks an Retry button

Yes − returns DialogResult.Yes, when user clicks an Yes button

The following diagram shows the common dialog class inheritance −

 


No comments:

Post a Comment