C# 0 The Complete Reference


PART II C h a p t e r   2 6



Download 4,07 Mb.
Pdf ko'rish
bet1070/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   1066   1067   1068   1069   1070   1071   1072   1073   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt


PART II

C h a p t e r   2 6 :  

U s e   S y s t e m . W i n d o w s . F o r m s  

863


  void MMExitClick(object who, EventArgs e) {

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

                            "Terminate",

                             MessageBoxButtons.YesNo);

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

  }


}

Sample output is shown in Figure 26-4.

This program defines two drop-down menus. The first is accessed via the File menu. It 

contains the Open, Close, and Exit selections. The menu handlers for Open and Close are 

simply placeholders that perform no function other than displaying a message box to that 

effect. The Close handler asks if you want to stop the program. If you answer Yes, the 

program is terminated.

The Tools menu has these selections: Coordinates, Change Size, and Restore. Selecting 

Coordinates causes the coordinates of the upper-left and lower-right corners of the window 

to be displayed in a message box. Try moving the window and then displaying its coordinates. 

Each time the window is moved to a new location, its coordinates change.

Choosing Change Size causes the window to be reduced in size so its width and height 

are both 200 pixels long. This is done through the 


Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   1066   1067   1068   1069   1070   1071   1072   1073   ...   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