Professional IronPython



Download 20,35 Mb.
Pdf ko'rish
bet382/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   378   379   380   381   382   383   384   385   ...   453
372

CHAPTER 17
ExtEnding ironPython Using VisUal Basic.nEt
One of the advantages of using Visual Basic.NET rather than C# to create 
Windows Forms classes is that Visual Basic.NET includes several additional 
predefined templates. In fact, Visual Basic.NET provides 11 templates rather 
than the seven templates provided in C#. The additional Visual Basic.NET 
templates include Dialog, Explorer Form, Login Form, and Splash Screen,
all of which are usable in IronPython.
2.
Highlight the Windows Form entry. Type 
TestForm.VB
in the Name field and click Add. 
Visual Studio adds the new form to your project and automatically opens it for editing.
3.
Create the form just as you normally would for any 
static application. Figure 17-9 shows the form used for 
this example. It’s simple, but it contains multiple data 
entry fields and multiple exit options.
The form shown in Figure 17-9 is a little deceptive. Before you 
assume anything about this form, it does have a few differences 
from the forms you’ve created for your static applications.
➤➤
Buttons that close the form, rather than do some-
thing within the form, must have the 
DialogResult
property set to a unique value or you won’t be able 
to tell which button the user clicked. For this exam-
ple, the 
DialogResult
for 
btnOK
is 
OK
, while the 
DialogResult
for 
btnCancel
is 
Cancel
.


Getting information from the form you create to the 
IronPython application can prove problematic. You could contrive all sorts of odd methods 
for accomplishing the task, but the simplest method is to set the 
Modifiers
property for the 
individual controls (
txtName
and 
txtColor
) to 
Public
. In this case, using 
Public
doesn’t 
create a problem because IronPython sets everything to public. In all other respects, there’s 
no difference between this form and any other form you’ve created in the past.
To make things simple, this example doesn’t use any code-behind for the form itself. Any code-
behind works as you’d expect. There isn’t any difference between calling the form from IronPython 
than calling it from within your Visual Basic.NET application.

Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   378   379   380   381   382   383   384   385   ...   453




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