C# 0 The Complete Reference


PART II C h a p t e r   2 6



Download 4,07 Mb.
Pdf ko'rish
bet1050/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   1046   1047   1048   1049   1050   1051   1052   1053   ...   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  

849


things as input and output by calling 

Read( )

 or 


WriteLine( )

. Thus, console programs call 

the operating system. The operating system does not call your program. However, in large 

measure, Windows works in the opposite way. It is Windows that calls your program. The 

process works like this: A program waits until it is sent a 

message

 by Windows. Once a 

message is received, your program is expected to take an appropriate action. Your program 

may call a method defined by Windows when responding to a message, but it is still 

Windows that initiates the activity. More than anything else, it is the message-based 

interaction with Windows that dictates the general form of all Windows programs.

There are many different types of messages that Windows may send to your program. 

For example, each time the mouse is clicked on a window belonging to your program, a 

mouse-clicked message will be sent. Another type of message is sent when a button is 

pressed or when a menu item is selected. Keep one fact firmly in mind: As far as your 

program is concerned, messages arrive randomly. This is why Windows programs resemble 

interrupt-driven programs. You can’t know what message will be next.



Windows Forms

At the core of a C# Windows program is the 



form.

 A form encapsulates the basic functionality 

necessary to create a window, display it on the screen, and receive messages. A form can 

represent any type of window, including the main window of the application, a child window, 

or even a dialog box.

When a form is first created, it is empty. To supply functionality, you add menus and 

controls, such as pushbuttons, lists, and check boxes. Thus, you can think of a form as a 

container for other Windows objects.

When a message is sent to the window, it is translated into an event. Therefore, to 

handle a Windows message, you will simply register an event handler for that message 

with the form. Then, whenever that message is received, your event handler is automatically 

called.



Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   1046   1047   1048   1049   1050   1051   1052   1053   ...   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