C# 0 The Complete Reference


ButtonBase , which inherits the  Control



Download 4,07 Mb.
Pdf ko'rish
bet1057/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   1053   1054   1055   1056   1057   1058   1059   1060   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

ButtonBase

,

which inherits the 



Control

 class. 


Button

 defines only one constructor, which is shown here:

public Button( )

This creates a button that has a default size and location within the window. It contains no 

description. Before a button can be used, it will need to be given a description by assigning 

a string to its 



Text

 property.

To specify the location of the button within the window, you must assign the 

coordinates of its upper-left corner to the 



Location

 property. The 



Location

 property is 

inherited from 

Control

 and defined like this:

public Point Location { get; set; }

The coordinates are contained within a 



Point

 structure, which is defined in the 



System.Drawing

namespace. It includes these two properties:

public int X { get; set; }

public int Y { get; set; }

Thus, to create a button that contains the description “Press Here” and is positioned at 

location 100, 200, use the following sequence:

Button MyButton = new Button();

MyButton.Text = "Press Here";

MyButton.Location = new Point(100, 200);

Adding a Button to a Form

After you have created a button, you must add it to a form. You do this by calling the 



Add( )

method on the collection of controls linked to that form. This collection is available through 

www.freepdf-books.com



Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   1053   1054   1055   1056   1057   1058   1059   1060   ...   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