(cid:134)04/07/2010

Buổi Buổi 22: : Control Class

Control Class –– QuảQuản n lý mã

lý mã llệệnhnh

(cid:153) Data type (cid:153)Cấu trúc rẽ nhánh (cid:153) Cấu trúc Lặp (cid:153) Khai báo biến, mảng (cid:153) Các phép toán thông dụng. (cid:153) Tìm hiểu Control Class

Windows Form programming with VB.Net 2005.

1

Data type Data type

SizeSize

Range Range

Short Short

2 bytes 2 bytes

32,768 (cid:198)(cid:198) 32,767 32,767 --32,768

UShort UShort

2 bytes 2 bytes

0 0 (cid:198)(cid:198) 65,535 65,535

Integer Integer

4 bytes 4 bytes

2,147,483,648 (cid:198)(cid:198) 2,147,483,647 2,147,483,647 --2,147,483,648

UInteger UInteger

4 bytes 4 bytes

0 0 (cid:198)(cid:198) 4,294,967,295 4,294,967,295

LongLong

8 bytes 8 bytes

9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 --9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

ULong ULong

8 bytes 8 bytes

0 0 (cid:198)(cid:198) 18,446,744,073,709,551,615 18,446,744,073,709,551,615

Single Single

4 bytes 4 bytes

3.4028235E+38 (cid:198)(cid:198) 3.4028235E+38 3.4028235E+38 --3.4028235E+38

Double Double

8 bytes 8 bytes

1.79769313486231E+308 (cid:198)(cid:198) 1.79769313486231E+308 1.79769313486231E+308 --1.79769313486231E+308

Decimal Decimal

16 bytes 16 bytes

79,228 x 1024 values up to +/--79,228 x 1024 values up to +/

ByteByte

1 byte 1 byte

0 0 (cid:198)(cid:198) 255 (no negative numbers) 255 (no negative numbers)

SByte SByte

1 byte 1 byte

128 (cid:198)(cid:198) 127127 --128

CharChar

16 bytes 16 bytes

65,535 Any Unicode symbol in the range 0––65,535 Any Unicode symbol in the range 0

String String

0 to 2 billion Unicode characters 0 to 2 billion Unicode characters

2 bytes per 2 bytes per character character

Boolean Boolean

2 bytes 2 bytes

True or False True or False

DateDate

8 bytes 8 bytes

January 1, 0001, (cid:198)(cid:198) December 31, 9999 December 31, 9999 January 1, 0001,

Object Object

4 bytes 4 bytes

Can cpntain data of any type Can cpntain data of any type

Windows Form programming with VB.Net 2005.

2

(cid:134)1

(cid:134)04/07/2010

BiBiếến:n:

* Khai báo biến: Dim as Vd: Dim x as Integer

* Khai báo mảng: Dim (so) as Vd: Dim Diem(4) as Integer

ReDim diem(5)

Windows Form programming with VB.Net 2005.

3

CáCác c phéphép p toátoán:n:

PhéPhéo o toátoánn ++ −− ** // Mô tảMô tả CộngCộng TrừTrừ NhânNhân ChiaChia

\\ Chia lấy phần nguyên Chia lấy phần nguyên

ModMod ^^ && Chia lấy phần dư Chia lấy phần dư Lũy thừa Lũy thừa Nối 2 chuỗi Nối 2 chuỗi

Windows Form programming with VB.Net 2005.

4

(cid:134)2

(cid:134)04/07/2010

CáCác c phéphép p toátoán n rúrút t gọgọn:n:

Operation Operation

X = X + 6 X = X + 6 X += 6 X += 6 ++

X = X –– 66 X = X X X --= 6= 6 --

X = X * 6 X = X * 6 X *= 6 X *= 6 **

X = X / 6 X = X / 6 X /= 6X /= 6 //

X = X \\ 66 X = X X X \\= 6= 6 \\

X = X ^ 6 X = X ^ 6 X ^= 6 X ^= 6 ^^

(&) (&) X = X & "ABC" X = X & "ABC" X &= "ABC" X &= "ABC"

Windows Form programming with VB.Net 2005.

5

ToáToán tn tử ử so so sásánh:nh:

Operator Operator

Mô tảMô tả

>>

Lớn hơn Lớn hơn

<<

Nhỏ hơn Nhỏ hơn

>=>=

Lớn hơn hoặc bằng Lớn hơn hoặc bằng

<=<=

Lớn hơn hoặc bằng Lớn hơn hoặc bằng

==

BằngBằng

<><>

KhácKhác

Windows Form programming with VB.Net 2005.

6

(cid:134)3

(cid:134)04/07/2010

n logic PhéPhép p toátoán logic

Operator Operator

Mô tảMô tả

NotNot

Phủ định Phủ định

AndAnd

True And True = True True And True = True (TH còn lại là False) (TH còn lại là False)

OrOr

False Or False = False False Or False = False (TH Còn lại là True) (TH Còn lại là True)

XorXor

= True 2 vế SS phủ định nhau = True 2 vế SS phủ định nhau = False 2 vế SS Không phủ định nhau = False 2 vế SS Không phủ định nhau

Windows Form programming with VB.Net 2005.

7

CCấấu u trútrúc c rẽ nhá

rẽ nhánh:nh:

IfIf <ĐK> IfIf <ĐK>

<ĐK> ThenThen [[CáCácc pháphátt bibiểểu]u] <ĐK> ThenThen [[CáCácc pháphátt bibiểểu]u]

EndEnd IfIf ElseElse

[[CáCácc pháphátt bibiểểu]u]

EndEnd IfIf

<ĐK> ThenThen [[CáCácc pháphátt bibiểểu]u]

IfIf <ĐK> ElseIf ElseIf [[CáCácc pháphátt bibiểểu]u] ElseElse [[CáCácc pháphátt bibiểểu]u] EndEnd IfIf

Windows Form programming with VB.Net 2005.

8

(cid:134)4

(cid:134)04/07/2010

Select Case Select Case

Tên B ếến>n>

Case Case <

Select Case <> Case <> [[CáCácc pháphátt bibiểểu]u] …….... Case Else Case Else

[[CáCácc pháphátt bibiểểu]u]

End Select End Select

Windows Form programming with VB.Net 2005.

9

i For VòVòng lng lặặp vp vớới For

CollectionObject> Item> In

t biểểu]u]

For Each For Each < [[CáCác c pháphát bi [Exit For] [Exit For]

NextNext

For For counter = start counter = start To To end [ end [Step Step stepstep]]

t biểểu]u]

[[CáCác c pháphát bi [Exit For] [Exit For]

NextNext

Windows Form programming with VB.Net 2005.

10

(cid:134)5

(cid:134)04/07/2010

VòVòng lng lặặp vp vớới Do

i Do ((kikiểểm tra ĐK r

m tra ĐK rồồi thi thựực hic hiệện)n)

dừng khi ĐK sai

Do While <ĐK đúng> [Các phát biểu] [Exit Do]

Loop

dừng khi ĐK đúng

Do Until <ĐK Sai> [Các phát biểu] [Exit Do]

Loop

Windows Form programming with VB.Net 2005.

11

VòVòng lng lặặp vp vớới Do

i Do ((ththựực hic hiệện tn tốối thi

i thiểểu u 11 llầần)n)

Do

[Các phát biểu] [Exit Do]

Loop While <ĐK đúng> ‘ dừng khi ĐK sai

Do

[Các phát biểu] [Exit Do]

Loop Until <ĐK Sai> ‘dừng khi ĐK đúng

Windows Form programming with VB.Net 2005.

12

(cid:134)6

(cid:134)04/07/2010

Windows Form programming with VB.Net 2005.

13

VDVD

Dim subfolders() As DirectoryInfo

Dim getDrive As String = cboDrive.SelectedItem subfolders = New DirectoryInfo(getDrive).GetDirectories lstData.Items.Clear() Dim subfolder As DirectoryInfo For Each subfolder In subfolders

lstData.Items.Add(subfolder.FullName)

Next

---------------------------------------------------------------------------------------------------

Dim allDrives() As DriveInfo = DriveInfo.GetDrives()

Dim d As DriveInfo For Each d In allDrives

If d.IsReady = True Then

'cboDrive.Items.Add("(" & d.VolumeLabel & ") " & d.Name) cboDrive.Items.Add(d.Name)

End If

Next

Windows Form programming with VB.Net 2005.

14

(cid:134)7

(cid:134)04/07/2010

Buổi 2: Contrl Class Buổi 2: Contrl Class

BackColor, Forcolor, Font, Forcolor, Font,

(cid:190)(cid:190)Properties Size, Location, Size, Name, Text,Text, BackColor, Properties:: Name, Image Location, Image

p hay không) cho phéphép hay không) n or hiệện)n)

CanFocus CanFocus Chỉ ra khi Focus Passed control Chỉ ra khi Focus Passed control Định dạng khi thiết kế Dock, Anchor Dock, Anchor Định dạng khi thiết kế True or False ((cho True or False Enable Enable True or False Visible True or False ((ẩẩn or hi Visible True or False True or False Locked Locked

Click, MouseMouse:: MouseMove, MouseDown, MouseMove, MouseDown, Event:: Click,

(cid:190)(cid:190)Event MouseUp…….. MouseUp

Windows Form programming with VB.Net 2005.

15

Contrl Class Contrl Class

(cid:190)(cid:190)TabControl TabControl (cid:190)(cid:190)PictureBox PictureBox (cid:190)(cid:190)ImageList ImageList (cid:190)(cid:190)Timer Timer (cid:190)(cid:190)ScrollBar ScrollBar (cid:190)(cid:190)Progressbar Progressbar (cid:190)(cid:190)ToolTip ToolTip (cid:190)(cid:190)NottifyIcon NottifyIcon (cid:190)(cid:190)MaskedTextBox MaskedTextBox (cid:190)(cid:190)Label, Label, LinkLabel LinkLabel (cid:190)(cid:190)ListView, TreeView ListView, TreeView (cid:190)(cid:190)CheckBox CheckBox (cid:190)(cid:190)RadioButton RadioButton (cid:190)(cid:190)TrackBar TrackBar (cid:190)(cid:190)Panel Panel (cid:190)(cid:190)GroupBox,Panel GroupBox,Panel (cid:190)(cid:190)TextBox,RichTextBox TextBox,RichTextBox (cid:190)(cid:190) DomainUpdown, DomainUpdown, NumericUpdown NumericUpdown

Windows Form programming with VB.Net 2005.

16

(cid:134)8

(cid:134)04/07/2010

(cid:153)(cid:153) Label: Label: a. Properties: a. Properties: Autosize: True or False Autosize: True or False

(cid:153)(cid:153) Button Button:: aa.. Properties TextAlign Properties:: TextAlign

(cid:153)(cid:153) LinkLabel LinkLabel:: aa.. Properties Properties:: LinkColor:: ++ LinkColor ActiveLinkColor:: ++ ActiveLinkColor ++ LinkVisible LinkVisible:: TrueTrue oror FalseFalse Event:: bb.. Event +LinkClicked +LinkClicked:: System..Diagnostics System Diagnostics..Process Process..Start("www vn") Start("www..vnnvnn..vn")

Windows Form programming with VB.Net 2005.

17

(cid:153)(cid:153) TextBox: TextBox:

dòng? ))

Multiline == TrueTrue

Properties:: aa.. Properties MaxLength:: ChiềuChiều dàidài tốitối đađa ++ MaxLength MultiLine:: TrueTrue oror FalseFalse (( xuxuốốngng dòng? ++ MultiLine ++ PasswordChar password PasswordChar:: kýký ttựự password ++ ReadOnly ReadOnly:: ScrollBars:: đkđk Multiline ++ ScrollBars bb.. Event Event:: The text in TextBox is Changed +TextChanged: The text in TextBox is Changed +TextChanged: , KeyUp: e.KeyCode + + KeyDown KeyDown, KeyUp: e.KeyCode + KeyPress: e.KeyChar + KeyPress: e.KeyChar Value of Multiline is Changed +MultiChanged: Value of Multiline is Changed +MultiChanged: c. Method: Clear, Copy, Cut, Paste, c. Method:

Focus Clear, Copy, Cut, Paste, Focus

Windows Form programming with VB.Net 2005.

18

(cid:134)9

(cid:134)04/07/2010

(cid:153)(cid:153) ComboBox: ComboBox:

a. Properties: a. Properties: + + Items: Add, RemoveAt, Clear, , xử lý on ListBox (Add, RemoveAt, Clear

Items: xử lý on ListBox ( Count…) Count…) chỉ mục hiện hành SelectedIndex: chỉ mục hiện hành

++ SelectedIndex: + SelectedItem: Item được chọn hiện hành + SelectedItem: Item được chọn hiện hành True or False + Sorted: True or False + Sorted:

b. Event: b. Event: SelectedIndexChanged: ++SelectedIndexChanged:

Windows Form programming with VB.Net 2005.

19

(cid:153)(cid:153):ListBox (soạn lại) :ListBox (soạn lại)

RemoveAt, ClearClear,, ListBox ((Add,Add, RemoveAt,

MultiSimple None, One,One, MultiSimple

Properties:: aa.. Properties ++ Items Items:: xửxử lýlý onon ListBox Count……)) Count ++ MultiColumn MultiColumn:: TrueTrue oror FalseFalse ++ SelectedIndex SelectedIndex:: GetGet oror SetSet vềvề chỉchỉ mụcmục hiệnhiện hànhhành ++ SelectedItem SelectedItem:: == Listbox Listbox..TextText ;; ++ Sorted Sorted:: TrueTrue oror FalseFalse SelectionMode:: None, ++ SelectionMode bb.. Event Event:: +SelectedIndexChanged +SelectedIndexChanged

Windows Form programming with VB.Net 2005.

20

(cid:134)10

(cid:134)04/07/2010

(cid:153)(cid:153)CheckedListBox: (soạn lại) CheckedListBox: (soạn lại)

RemoveAt, ClearClear,, ListBox ((Add,Add, RemoveAt,

Properties:: aa.. Properties ++ Items Items:: xửxử lýlý onon ListBox Count……)) Count bb.. Event Event:: +SelectedIndexChanged SelectedValueChanged:: +SelectedIndexChanged -- SelectedValueChanged c. Method: SetItemChecked(index, True/False) GetItemChecked(index) = True/False

Windows Form programming with VB.Net 2005.

21

Ví dụ: Ví dụ:

Windows Form programming with VB.Net 2005.

22

(cid:134)11

(cid:134)04/07/2010

DomainUpdown and NumericUpdown: DomainUpdown and NumericUpdown:

(cid:153)(cid:153) DomainUpdown DomainUpdown Properties:: aa.. Properties Items:: tậptập hợphợp cáccác nộinội dungdung hiểnhiển thịthị ++ Items Sorted:: TrueTrue oror FalseFalse ++ Sorted ++ WrapWrap:: TrueTrue oror FalseFalse (xoay ++ SelectedItem+ SelectedItem+ SelectedIndex vòng) (xoay vòng) ComboBox) SelectedIndex:: (=(= ComboBox)

Minimun:: giágiá trịtrị [Min [Min……Max]Max]

(cid:153)(cid:153) NumericUpdown NumericUpdown:: Properties:: aa.. Properties ++ Maximum, Maximum, Minimun ++ ValueValue:: trảtrả vvềề giágiá trịtrị hihiệệnn hàhànhnh Increment:: ấấnn đđịịnhnh giágiá trịtrị tăng ++ Increment tăng (default= (default=11))

Windows Form programming with VB.Net 2005.

23

: DomainUpdown and NumericUpdown: Vi Vi dụdụ: DomainUpdown and NumericUpdown:

Windows Form programming with VB.Net 2005.

24

(cid:134)12

(cid:134)04/07/2010

(cid:153)(cid:153) DateTimePicker : DateTimePicker :

tháng nămnăm được Thông tintin ngàyngày tháng

được chọnchọn day, month, year, Date, Hour, obj ở đây là: day, month, year, Date, Hour,

Custom Time, Custom Short, Time, Long, Short,

Properties:: aa.. Properties ++ TextText:: Thông + Value. + Value.objobj: : obj ở đây là: minute, second, millisecond, DayofYearm, minute, second, millisecond, DayofYearm, DayofWeek….. DayofWeek….. Format:: Long, ++ Format CustomFormat:: dùdùngng khikhi Format ++ CustomFormat ShowUpDown:: GiốngGiống dạngdạng ……Updown ++ ShowUpDown Custom Format làlà Custom Updown ởở trêntrên

MonthCalendar:: 88.. MonthCalendar Properties:: aa.. Properties ++ SelectionRange SelectionRange..Start, DateTime khikhi ứngứng dụngdụng được DateTime Start, SelectionRange SelectionRange..EndEnd:: GetGet oror SetSet chạy được chạy

Windows Form programming with VB.Net 2005.

25

: DateTimePicker & MonthCalendar: Ví dụVí dụ: DateTimePicker & MonthCalendar:

Windows Form programming with VB.Net 2005.

26

(cid:134)13

(cid:134)04/07/2010

Value

Description

Day of month as digits with no leading zero for single-digit days.

d

Day of month as digits with leading zero for single-digit days.

dd

Day of week as a three-letter abbreviation.

ddd

Day of week as its full name.

dddd

Month as digits with no leading zero for single-digit months.

M

Month as digits with leading zero for single-digit months.

MM

MMM

Month as a three-letter abbreviation.

MMMM

Month as its full name.

Year as last two digits, with no leading zero for years less than 10.

y

Year as last two digits, with a leading zero for years less than 10.

yy

yyyy

Year represented by full four digits.

Windows Form programming with VB.Net 2005.

Value

Description

Hours with no leading zero for single-digit hours; 12-hour clock

h

Hours with leading zero for single-digit hours; 12-hour clock

hh

Hours with no leading zero for single-digit hours; 24-hour clock

H

Hours with leading zero for single-digit hours; 24-hour clock

HH

Minutes with no leading zero for single-digit minutes

m

Minutes with leading zero for single-digit minutes

mm

Seconds with no leading zero for single-digit seconds

s

Seconds with leading zero for single-digit seconds

ss

One character time marker string, such as A or P

t

Multicharacter time marker string, such as AM or PM

tt

Windows Form programming with VB.Net 2005.

(cid:134)14

(cid:134)04/07/2010

(cid:153)(cid:153) Timer Timer

Milliseconds giữagiữa

thời giangian inin Milliseconds (default=100100)) timer (default=

thời giangian Interval Interval trôi timer trôi quaqua vàvà timer

enabled timer isis enabled

timer whenwhen timer timer ifif itit hashas beenbeen already started already started Properties:: aa.. Properties Interval:: mômô tảtả chuchu kỳkỳ thời ++ Interval mỗimỗi nhịpnhịp (tick) (tick) củacủa timer Event:: bb.. Event thực khikhi thời ++ TickTick:: thực enabled timer isis enabled timer bb.. MethodMethod:: ++ Start Start:: Starts ++ StopStop:: Stops Starts thethe timer Stops thethe timer

ImageList: a. Properties

a. Properties: + Images:

lưu danh : + Images: lưu danh

(cid:153)(cid:153) ImageList: sách các Image sách các Image

Windows Form programming with VB.Net 2005.

29

(cid:153)(cid:153) PictureBox: PictureBox:

Image cầần hin hiểển n thịthị

Get or Set Image từ ừ ImageList ho

ImageList hoặặc tc từ ừ

Properties a.a.Properties + + ImageLocation ImageLocation: : đđườường dng dẫẫn n 1 1 Image c + Image: Get or Set Image t + Image: resource khi thi resource khi thiếết kt kế ế + SizeMode: cácách image đ + SizeMode:

ch image đượược hic hiểển n thịthị

(cid:153)(cid:153) ImageList: ImageList: a. Properties a. Properties: : p các Image + Images: quảquản n lý lý ttậập hp hợợp các Image + Images: + Images.(Index): c set a Image đượược set Index củcủa Image đ + Images.(Index): Index Image trong ImageList + Images.Count: ssố ố Image trong ImageList + Images.Count: + ImageSize: kíkích th + ImageSize:

ch thướước Image (default

c Image (default 1616xx1616))

Windows Form programming with VB.Net 2005.

30

(cid:134)15

(cid:134)04/07/2010

Vd: Timer -- PictureBox Vd: Timer

ImageList: PictureBox -- ImageList:

Windows Form programming with VB.Net 2005.

31

. ProgressBar 99. ProgressBar

ProgresBar trong ProgresBar

Increment:: didi chuyển chuyển vịvị trítrí ofof ProgresBar tăng ProgresBar == cáchcách tăng

ProgresBar == cáchcách chỉchỉ chuyển vịvị trítrí ofof ProgresBar

Properties:: aa.. Properties Maximum:: MaxMax ValueValue ofof ProgresBar ++ Maximum ProgresBar ProgresBar Minimum:: MinMin ValueValue ofof ProgresBar ++ Minimum cursor trong ++ ValueValue:: VịVị trítrí hiệnhiện tạitại củacủa cursor method PerformStep method ++ StepStep:: mômô tảtả giágiá trịtrị == PerformStep bb.. MethodMethod:: ++ Increment value value +PerformStep +PerformStep:: didi chuyển rara value value inin StepStep

Windows Form programming with VB.Net 2005.

32

(cid:134)16

(cid:134)04/07/2010

. TrackBar 99. TrackBar

ProgresBar trong ProgresBar

TrackBar chuyển TrackBar

Properties:: aa.. Properties Maximum:: MaxMax ValueValue ofof ProgresBar ++ Maximum ProgresBar ProgresBar Minimum:: MinMin ValueValue ofof ProgresBar ++ Minimum ++ ValueValue:: VịVị trítrí hiệnhiện tạitại củacủa cursor cursor trong TrackBar TickStyle:: địnhđịnh dạngdạng TrackBar ++ TickStyle Event:: bb.. Event ++ Scorll Scorll:: ThựcThực thithi khikhi didi chuyển changed +Valuechanged:: ThựcThực thithi khikhi ValueValue isis changed +Valuechanged

Windows Form programming with VB.Net 2005.

33

Vd: TrackBar: Vd: TrackBar:

Windows Form programming with VB.Net 2005.

34

(cid:134)17

(cid:134)04/07/2010

Panel and GroupBox: Panel and GroupBox:

GroupBox Control Control chủchủ yếuyếu đểđể chứa

cùng mộtmột nhómnhóm đểđể thực

chứa cáccác thực hiệnhiện táctác vụvụ trong lậplập công việcviệc trong

Panel andand GroupBox Panel control control kháckhác vàovào cùng nhằmnhằm thuận trình, thường trình, thuận lợilợi chocho việcviệc quảnquản lýlý công thường làlà cáccác CheckBox, CheckBox, RadioButton RadioButton……

control được check được check object checkbox cócó ththểể chọchọnn object

(cid:153)(cid:153) CheckBox RadioButton CheckBox andand RadioButton Properties:: aa.. Properties ++ Checked check) Checked:: TrueTrue oror FalseFalse (kiểm(kiểm tratra check) Event:: bb.. Event ++ CheckedChanged CheckedChanged:: khikhi control (cid:153)(cid:153) GhiGhi chúchú:: mmộộtt GroupGroup checkbox nhinhiềềuu nhưng RadioButton thìthì chỉchỉ chọchọnn 11 nhưng RadioButton

Windows Form programming with VB.Net 2005.

35

Vd: Group control Vd: Group control

Windows Form programming with VB.Net 2005.

36

(cid:134)18

(cid:134)04/07/2010

TabControl: TabControl:

thực thithi SelectedIndex SelectedIndex đđượượcc

Properties:: aa.. Properties TabCount:: TrueTrue oror FalseFalse (kiểm(kiểm tratra check) ++ TabCount check) tạoTabpage soát vàvà tạoTabpage TabPages:: dùngdùng kiểmkiểm soát ++ TabPages TabIndex:: TrảTrả vvềề Index ++ TabIndex TabPage ((00……nn--11)) Index củcủaa TabPage TabIndex hihiệệnn hàhànhnh SelectedIndex:: GetGet oror SetSet TabIndex ++ SelectedIndex Event:: bb.. Event SelectedIndexChanged:: thực ++ SelectedIndexChanged thay đđổổii thay

Windows Form programming with VB.Net 2005.

37

c Group control Ví dụVí dụ: : cácác Group control

Windows Form programming with VB.Net 2005.

38

(cid:134)19

(cid:134)04/07/2010

ListView: ListView:

Detail, ListList SmallIcon, Detail,

theo ViewView

Descending)) Ascending, Descending

Properties:: aa.. Properties Columns:: QuảQuảnn lýlý CCộộtt củcủaa ListView ++ Columns ListView ++ Items Items:: SSốố dòdòngng vàvà cácácc thàthànhnh phphầầnn củcủaa dòdòngng LargeIcon, SmallIcon, ++ ViewView:: LargeIcon, ++ GroupGroup:: dùdùngng chiachia nhónhómm theo Multiselect:: TrueTrue oror FalseFalse ++ Multiselect ++ Sorting Sorting:: ((Ascending, Event:: bb.. Event ColumnClick:: ththựựcc thithi khikhi ccộộtt đđượượcc clickclick ++ ColumnClick cc.. MethodMethod:: ++ ClearClear:: xóxóaa ttấấ cảcả cácácc ItemItem trong ListView trong ListView

Windows Form programming with VB.Net 2005.

39

TreeView: TreeView:

Nodes:: kikiểểmm soásoátt cácácc NodeNode trong trong mmộộtt TreeTree

aa.. Properties Properties:: +HotTracking Hyperlink) +HotTracking::TrueTrue oror FalseFalse ((hihiểểnn thịthị Hyperlink) ++ Nodes ra Index of a Image in ImageList +ImageIndex: +ImageIndex: chỉ chỉ ra Index of a Image in ImageList Image cócó ththểể hihiểểnn thịthị ++ ImageList ++ SelectedNode ++ CheckBoxes ImageList:: DanhDanh sásáchch Image SelectedNode:: GiữGiữ NodeNode hiệnhiện hànhhành được CheckBoxes:: cócó thêmthêm check được chọnchọn TreeView trong TreeView check boxbox trong

ExpandAll:: cheche llấấpp,, mmởở rrộộngng

bb.. MethodMethod:: ++ CollapseAll, ++ GetNodeCount CollapseAll, ExpandAll GetNodeCount:: trảtrả vvềề ssốố NodeNode ofof TreeTree

Windows Form programming with VB.Net 2005.

40

(cid:134)20

(cid:134)04/07/2010

TreeView: TreeView:

Event:: cc.. Event

++ AfterCheck, BeforeCheck:: AfterCheck, BeforeCheck

++ AfterCollapse, BeforeCollapse:: AfterCollapse, BeforeCollapse

++ AfterExpand, BeforeExpand:: AfterExpand, BeforeExpand

++ AfterSelect, AfterSelect, BeforeSelect BeforeSelect ::

Windows Form programming with VB.Net 2005.

41

(cid:134)21