C# 0 The Complete Reference



Download 4,07 Mb.
Pdf ko'rish
bet1065/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   1061   1062   1063   1064   1065   1066   1067   1068   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

StopButtonClick( )

.

Inside


StopButtonClick( )

, the message box is displayed by the following statement:

// If user answers Yes, terminate the program.

DialogResult result = MessageBox.Show("Stop Program?",

                        "Terminate",

                        MessageBoxButtons.YesNo);

Here, the message inside the box is “Stop Program?”, the caption is “Terminate,” and the 

buttons to be displayed are Yes and No. When 



Show( )

 returns, the user’s response is 

assigned to 

result

. That response is then examined by the following statement to determine 

the course of action:

if(result == DialogResult.Yes) Application.Exit();

If the user clicks the Yes button, the program is stopped by calling 

Application.Exit( )

,

which causes the immediate termination of the program. Otherwise, no action is taken, and 



the program continues running.

Sample output is shown in Figure 26-3.

F

IGURE


 26-3 

Sample output 

from the Stop 

Button program

www.freepdf-books.com



Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   1061   1062   1063   1064   1065   1066   1067   1068   ...   1096




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish