Cov txheej txheem:
- Kauj Ruam 1: Tsim Txoj Haujlwm
- Kauj Ruam 2: Ntxiv Cov Kev Tswj, thiab Hloov Cov Khoom
- Kauj ruam 3: Code
- Kauj Ruam 4: Ntau Yam
- Kauj Ruam 5: Chaw Nyob
- Kauj Ruam 6: Nqis Tes Ua
- Kauj Ruam 7: Status Bar
- Kauj ruam 8: Comlete
- Kauj Ruam 9: Kev daws teeb meem
Video: Tsim Txoj Haujlwm Hauv Visual Basic: Web Browser: 9 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:31
Cov Lus Qhia no piav qhia tus txheej txheem ntawm kev tsim lub vev xaib yooj yim thov hauv VB. NETIt yog tsim los ua raws kuv qab VB. NET thawj zaug Qhia: Tsim Koj Thawj Qhov Kev Kawm Hauv Visual Basic. Nws tau pom zoo tias koj nyeem dhau qhov kev qhia ua ntej, raws li cov lus qhia no xav tias koj muaj kev paub pib ntawm Visual Basic Express Edition Interface, raws li tau hais hauv kuv lwm qhov kev qhia. Visual Basic 2008 Express Edition, muaj los ntawm Microsoft
Kauj Ruam 1: Tsim Txoj Haujlwm
Tsim qhov tshiab Windows Forms Project, thiab hu nws Web Browser. Resize daim ntawv rau koj nyiam.
Kauj Ruam 2: Ntxiv Cov Kev Tswj, thiab Hloov Cov Khoom
Los ntawm lub cuab yeej, rub TextBox, WebBrowser thiab A Button mus rau hauv daim ntawv. Muab lawv zoo li lawv nyob hauv daim duab. Tom qab ntawd, hloov kho Thauj Khoom cov cuab yeej ntawm TextBox thiab WebBrowser kom tag nrho cov thawv nyob ib puag ncig lub xwmfab grey (qhia thaum koj hloov kho cov khoom thauj tog rau nkoj) raug xaiv, qhov no yuav tso cai rau kev tswj kom 'ncab' thaum daim ntawv hloov pauv. Ua tib yam rau Khawm, tab sis tsuas yog teeb nws rau "Sab Saum, Txoj Cai". Txhua yam hloov cov ntawv Cov cuab yeej ntawm Form1 rau Web Browser, lossis qee yam zoo sib xws los hloov lub npe kab.
Kauj ruam 3: Code
Nyem ob npaug rau ntawm Button1, thiab ntxiv cov cai hauv qab no rau tus editor, tom qab kab "Ntiag Tug" thiab ua ntej kab "End Sub"
WebBrowser1. Navigate (TextBox1. Text)Txoj cai no yooj yim qhia txoj haujlwm: Thaum ib tus neeg nyem khawm 1, Tau WebBrowser Txhawm rau Nkag mus rau txhua yam uas nyob hauv TextBox1 Ntawd Yog! Koj muaj lub web browser ua haujlwm. Nias lub pob ua si los sim nws.
Kauj Ruam 4: Ntau Yam
Tam sim no, koj tsis xav tias kuv tsuas yog yuav muab ib kab rau koj - puas yog? Hla ob peb kauj ruam tom ntej, peb yuav siv cov hauv qab no:
- Qhov chaw nyob bar uas hloov pauv thaum nplooj ntawv hloov pauv
- Rov qab, rau pem hauv ntej thiab hloov kho cov nyees khawm
- Qhov xwm txheej bar.
Kauj Ruam 5: Chaw Nyob
Tam sim no, txhua qhov chaw nyob bar qhia tawm nplooj ntawv uas koj ntaus, yog tias koj nyem rau ntawm qhov txuas, qhov kev hloov pauv tsis cuam tshuam rau hauv qhov chaw nyob bar. Txhawm rau kho qhov no, peb yuav tsum tau ntxiv qee qhov chaws rov qab mus rau qhov tsim qauv, nyem rau ntawm "Form 1.vb (Tsim)" thiab tom qab ntawd ob npaug nyem rau ntawm WebBrowser tswj. Nws yuav hloov rov qab mus rau txoj cai saib, txawm li cas los yuav muaj qee qhov chaws ntxiv, ceeb toom tias nws hais tias "WebBrowser1_DocumentCompleted", qhov no yog tus lej peb xav tau, yog li peb tsis tas yuav hloov dab tsi ntawm no, tab sis muaj qhov khoob kab hauv qab qhov ntawd, ua ntej End Sub nqe lus, thiab peb xav ntxiv qee qhov chaws nyob ntawd. Ntaus cov ntawv hauv qab no
TextBox1. Text = WebBrowser1. Url. ToStringQhov no qhia qhov haujlwm uas ib zaug WebBrowser1_DocumentCompleted, peb yuav tsum hloov TextBox1. Text rau WebBrowser1. Url. ToString nyob ntawd vim tias, los ntawm lub neej ntawd, cov cuab yeej URL ntawm lub vev xaib tsis zoo ib yam cov ntaub ntawv (hlua), raws li xav tau los ntawm peb lub thawv ntawv. ToString sau qhov URL rau txoj hlua rau TextBox.
Kauj Ruam 6: Nqis Tes Ua
Hloov rov qab los tsim saib thiab luag 3 lub nyees khawm tshiab rau hauv daim ntawv thiab tso lawv. Hloov Cov Ntawv Cov Khoom ntawm txhua tus: Button2 = Back, Button3 = Forward thiab Button4 = Refresh. Yog tias koj tso lawv zoo li kuv, kho cov khoom thauj tog rau nkoj ntawm Refresh to Top, RightDouble nyem rau ntawm Lub Pob Rov Qab, thiab ntaus cov cai hauv qab no.
WebBrowser1. GoBack () Rov qab rau kev tsim, ob npaug nias rau Forward thiab ntaus ntawv
WebBrowser1. GoForward ()Tsim kev pom, thiab ob npaug nyem rau Refresh
WebBrowser1. Refresh ()Kuaj qhov browser, thiab sim tawm cov yam ntxwv tshiab.
Kauj Ruam 7: Status Bar
Rov qab rau hauv kev tsim qauv, ntxiv daim ntawv lo, hloov Cov Ntawv rau "Chaw thau khoom …" (yam tsis muaj nqe lus) Tam sim no, mus rau hauv txoj cai saib los txhaj rau ntawm Form1.vb tab. Nrhiav WebBrowser1_DocumentCompleted nkag thiab ntaus hauv qab cov cai koj tau tso rau ntawd ua ntej
Label1. Text = "Ua tiav"Tam sim no, nyem rau ntawm qhov chaws hais tias DocumentCompleted. Tsiv koj tus nas mus rau qhov uas ob lub thawv tso rau hauv. Xaiv qhov thib ob (Qhov uas hais tias DocumentCompleted) thiab xaiv Navigating. Tom qab ntawd, qee qhov cai tshiab yuav tshwm sim - ntaus ntawv
Label1. Text = "Chaw thau khoom"Qhov no tsuas yog muab qhov taw qhia thaum nplooj ntawv tab tom thauj khoom.
Kauj ruam 8: Comlete
Koj mus. Koj muaj lub web browser ua haujlwm tau zoo. Khaws ntawm kev kho nws raws li koj xav tau. Zoo li hauv kuv thawj qhov kev qhia. Kuv muaj qee cov ntawv ua tom tsev rau cov uas ua tiav cov lus qhia no. Kuv ua raws li hauv qab no:
- Kev ua haujlwm hauv tsev
- Hloov qhov Hloov Tshiab khawm mus rau Nres Nres thaum nplooj ntawv rub tawm.
Kuv vam tias cov haujlwm no tau qhia koj yooj yim npaum li cas rau txoj haujlwm!
Kauj Ruam 9: Kev daws teeb meem
Rau cov uas ua tiav kuv thawj VB cov lus qhia - Kuv muaj cov kev daws rau cov ntawv ua tom tsev kuv teeb tsa thaum kawg.
Hloov xim tom qab
Nov yog qhov yooj yim - Hloov cov khoom BackColour ntawm Form1 rau xim sib txawv
Ntxiv qee cov ntaub ntawv ntiag tug
Ib daim ntawv tshiab nrog cov khoom hloov pauv yuav ua qhov dag
Ua daim ntawv hloov me me nrog Daim Duab
Hloov AutoSize kom tseeb thiab AutoSizeMode rau GrowAndShrinkDone! Tseem yuav los: Kuv yuav tsim qee qhov ntxiv VB. NET Cov Lus Qhia Khaws Coding!
Pom zoo:
Siv Kev Cia Siab Lub Hauv Paus txuas ntxiv txhawm rau Nrhiav Lub Tuam Tsev Tsis Ua Haujlwm Txoj Cai Ua Haujlwm Hauv Koj Tsev Neeg Tsob Ntoo ntawm Kev Tshawb Nrhiav Tsev Neeg: 11 Kauj Ruam
Siv Kev Cia Siab Lub Hauv Paus Txuas Ntxiv kom Nrhiav Lub Tuam Tsev Tsis Ua Haujlwm Ua Haujlwm Hauv Koj Tsev Neeg Tsob Ntoo ntawm Kev Tshawb Nrhiav Tsev Neeg: Lub hom phiaj ntawm cov lus qhia no yog los qhia seb yuav tshawb nrhiav koj tsev neeg tsob ntoo li cas hauv Tsev Neeg Nrhiav rau cov poj koob yawm txwv nrog kev ua haujlwm hauv lub tuam tsev tsis tiav siv Kev Cia Siab lub hauv siab txuas ntxiv. Siv Kev Cia Siab Lub Hauv Paus tuaj yeem ua rau koj qhov kev tshawb nrhiav tsis tiav
Ultrasonics Raws Txoj Haujlwm Txoj Haujlwm: 4 Kauj Ruam (nrog Duab)
Ultrasonics Raws Qhov Txheej Txheem: Txhua qhov hloov pauv ntawm ultrasonic radars Kuv tau pom rau cov khoom siv arduino (Arduino - Radar/Ultrasonic Detector, Arduino Ultrasonic Radar Project) zoo heev radars tab sis txhua tus ntawm lawv yog "dig muag". Kuv txhais tau tias, lub radar pom qee yam tab sis kuv
Yooj Yim ABB PLC Txoj Haujlwm- Txoj Haujlwm Kawm Ntawv: 17 Kauj Ruam (nrog Duab)
Yooj Yim ABB PLC Txoj Haujlwm- Txoj Haujlwm Kev Kawm: Nov yog txoj haujlwm yooj yim uas lub hom phiaj rau kev siv CoDesys software nrog Ladder Diagram (LD) lus. muaj nuj nqi .., Sau cov txheej txheem
Tsim Koj Thawj Txoj Haujlwm hauv Visual Basic: 7 Kauj Ruam
Tsim Koj Thawj Qhov Kev Kawm Hauv Visual Basic: Cov lus qhia no yuav qhia koj yuav ua li cas rau nruab Microsoft Visual Basic 2005 Express Edition. Piv txwv uas koj yuav tsim hnub no yog tus saib duab yooj yim. Yog tias koj nyiam qhov kev qhia no thov thawb + khawm rau saum cov lus qhia Ua tsaug
Ua Web Browser hauv Visual Basic: 12 Kauj Ruam
Ua Lub Vev Xaib Hauv Visual Basic: Kuv yuav qhia koj li cas los ua lub vev xaib hauv Visual Basic 2005