Lub tswv yim ntawm cov ntawv raws li interface ntsiab, encapsulating lub luag haujlwm ntawm lub qhov rais thiab abstracting ntau yam ntawm kev ua haujlwm nrog lawv, yog khov kho hauv cov hauj lwm ntawm daim ntawv thov lub cajmeem. Ntau lub vev xaib thiab kev thau khoom feem ntau muaj lawv tus kheej ua tiav cov tswv yim no. Raws li, txhawm rau tswj hwm daim ntawv, piv txwv li, kom kaw nws, koj yuav tsum siv ntau hom kev qhia.
Tsim nyog
- - kev loj hlob ib puag ncig lossis cov ntawv sau lus;
- - lub peev xwm los hloov qhov program code.
Cov Lus Qhia
Kauj ruam 1
Tau txais tus coj mus rau lub qhov rais, khoom, siv, lossis pointer rau yam khoom ntawm daim ntawv uas koj xav kaw. Raws li txoj cai, yuav tsum tau piav qhia tsuas yog thaum lub cajmeem tsis nyob rau hauv Windows tsis siv ib qho qauv (siv tsuas yog API). Hauv lwm qhov xwm txheej, kev ua nrog cov ntawv feem ntau yog ua los ntawm cov khoom sib xws. Txij li thaum daim foos tau qhib ua ntej, cov khoom sib nug tau raug tsim. Siv nws. Hauv cov cai ntawm cov txheej txheem ntawm ib daim ntawv hauv chav kawm, nkag mus rau cov txheej txheem thiab cov yam ntxwv ntawm nws cov khoom feem ntau tau los ntawm cov cim xws li qhov no (C ++, C #), tus kheej (Delphi), Me (Visual Basic), lossis yoojyim los ntawm lub npe, txij li lawv nkag mus tau los ntawm cov khoom tam sim no.
Kauj ruam 2
Kaw daim foos tsim raws cov qauv kev sib tham, paub nws kov. Yog tias koj xav tau qhov kev zov me nyuam tuaj yeem ua qee qhov kev ua haujlwm ntawm kev kaw thiab, tej zaum, tiv thaiv nws, xa WM_CLOSE cov lus rau lub qhov rais:
:: PostMessage (h, WM_CLOSE, 0, 0);
Txwv tsis pub, tsuas yog rhuav tshem nws los ntawm kev hu rau DestroyWindow:
:: DestroyWindow (h);
Ntawm no h yog qhov kov rau lub qhov rais.
Kauj ruam 3
Txhawm rau kaw daim foos hauv ib qho program uas khiav Microsoft. NET Framework, siv hom qauv ze ntawm nws qhov khoom (qhov no yog qhov khoom ntawm Form chav hauv System. Windows. Forms namespace). Piv txwv li, los ntawm hom kev ntawm ib daim qauv hauv chav kawm, ib tsab xov tooj tuaj yeem tsim tau zoo li no:
no. Close ();
Tom qab ntawv, yog tias daim ntawv yog ib feem ntawm MDI daim ntawv thov lossis tau muab tso rau pom los ntawm kev hu ShowDialog, kuj hu rau Cov Khoom Pov Tseg kom tus neeg khib nyiab tuaj yeem tsis nco qab.
Kauj ruam 4
Hauv Delphi, siv tus qauv kaw cov qauv kaw. Lwm txoj kev, rau cov qauv ntawv modal, koj tuaj yeem tsim ModalResult cov khoom ntiag tug rau tus nqi tsis yog xoom. Cov kev ntsuas nquag siv feem ntau yog mrOk, mrCancel, thiab lwm yam.
Kauj ruam 5
Cov ntawv ntawm Microsoft chav ua haujlwm thov hauv VBA cov ntawv tuaj yeem raug kaw los ntawm kev hu xov tooj rau Hide txoj kev ntawm lawv cov khoom. Piv txwv li, los ntawm qhov tshwm sim handler ntawm ib daim ntawv lossis nws tswj hwm, koj tuaj yeem ua nws zoo li no:
Me. Hais