
Windows Form programming with VB.Net 2005. 1
Bu
Buổ
ổi 4:
i 4: Menu
Menu –
–ToolBar
ToolBar
ToolStrip
ToolStrip
ToolStripContainer
ToolStripContainer
StatusStrip
StatusStrip
MenuStrip
MenuStrip
MenuStripContext
MenuStripContext
NotifyIcon
NotifyIcon
Windows Form programming with VB.Net 2005. 2
ToolStrip
ToolStrip
T
Từ
ừVisual Studio 2005 g
Visual Studio 2005 gọ
ọi ToolBar l
i ToolBar là
àToolStrip
ToolStrip

Windows Form programming with VB.Net 2005. 3
ToolStrip
ToolStrip
1.
1. Properties
Properties:
:
-
-Item:
Item: Qu
Quả
ản lý vi
n lý việ
ệc thêm (Add), x
c thêm (Add), xó
óa (remove)
a (remove)
c
cá
ác th
c thà
ành ph
nh phầ
ần c
n củ
ủa ToolStrip
a ToolStrip
-
-TextDirection:
TextDirection: Hi
Hiể
ển th
n thị
ịText c
Text củ
ủa c
a cá
ác th
c thà
ành
nh
ph
phầ
ần c
n củ
ủa ToolStrip theo chi
a ToolStrip theo chiề
ều ngang
u ngang
(
(Horizontal
Horizontal), d
), dọ
ọc theo chi
c theo chiề
ều kim đ
u kim đồ
ồng h
ng hồ
ồ
(
(Vertical90, Vertical270)
Vertical90, Vertical270)…
…
-
-LayoutStyle:
LayoutStyle: X
Xá
ác đ
c đị
ịnh v
nh vị
ịtr
trí
íToolStrip theo
ToolStrip theo
chi
chiề
ều ngang (
u ngang (Horizontal
Horizontal), d
), dọ
ọc (
c (Vertical
Vertical)
)…
…
-
-RenderMode:
RenderMode: X
Xá
ác đ
c đị
ịnh lo
nh loạ
ại ToolStrip theo ch
i ToolStrip theo chế
ế
đ
độ
ộSystem,
System, Professional
Professional…
…
Windows Form programming with VB.Net 2005. 4
Item c
Item củ
ủa ToolStrip:
a ToolStrip: (ti
(tiế
ếp theo)
p theo)
Item
Item ở
ở đây l
đây là
àm
mộ
ột đ
t đố
ối tư
i tượ
ợng thu
ng thuộ
ộc
c
ToolStripItem class
ToolStripItem class qu
quả
ản lý vi
n lý việ
ệc thi
c thiế
ết k
t kế
ếv
và
àvi
viế
ết
t
code cho ToolStrip. C
code cho ToolStrip. Cá
ác
c ToolStripItem
ToolStripItem ở
ở đây
đây
thư
thườ
ờng l
ng là
à:
:
-
-ToolStripButton (Button)
ToolStripButton (Button)
-
-ToolStripLabel (Label)
ToolStripLabel (Label)
-
-ToolStripSeparator
ToolStripSeparator
-
-ToolStripTextBox (TextBox)
ToolStripTextBox (TextBox)
-
-ToolStripComboBox (Combobox)
ToolStripComboBox (Combobox)
-
-ToolStripDropDownButton, ToolStripSplitButton
ToolStripDropDownButton, ToolStripSplitButton
-
-ToolStripProgressBar (Progressbar)
ToolStripProgressBar (Progressbar)

Windows Form programming with VB.Net 2005. 5
Item as ToolStripItem
Item as ToolStripItem
1. Properties:
1. Properties:
-
-Text:
Text: N
Nộ
ội dung c
i dung củ
ủa Item
a Item
-
-TextAlign:
TextAlign: Căn l
Căn lề
ềcho Text so v
cho Text so vớ
ới ToolstripItem
i ToolstripItem
-
-TextDirection:
TextDirection: Text theo chi
Text theo chiề
ều ngang or d
u ngang or dọ
ọc
c
-
-TextImageRelation:
TextImageRelation: Quan h
Quan hệ
ệgi
giữ
ữa Text v
a Text và
àImage
Image
(ch
(chồ
ồng gh
ng ghé
ép,
p, trên,
trên, dư
dướ
ới,
i, trư
trướ
ớc, sau)
c, sau)
•
•Overlay
Overlay
•
•ImageAboveText
ImageAboveText
•
•TextAboveImage
TextAboveImage
•
•ImageBeforeText
ImageBeforeText
•
•TextBeforeImage
TextBeforeImage
Windows Form programming with VB.Net 2005. 6
Overlay
Overlay
ImageAboveText
ImageAboveText
TextAboveImage
TextAboveImage
ImageBeforeText
ImageBeforeText
TextBeforeImage
TextBeforeImage

Windows Form programming with VB.Net 2005. 7
Item as ToolStripItem (tt)
Item as ToolStripItem (tt)
1. Properties:
1. Properties:
-
-Image:
Image: image hi
image hiể
ển th
n thị
ị
-
-ImageAlign:
ImageAlign: Căn l
Căn lề
ềcho image so v
cho image so vớ
ới Toolstrip
i Toolstrip
-
-ImageTransparent:
ImageTransparent: l
là
àm trong su
m trong suố
ốt m
t mà
àu of image
u of image
-
-DisplayStyle:
DisplayStyle: None, Text, Image, ImageAndText
None, Text, Image, ImageAndText
-
-Alignment:
Alignment: Đ
Đị
ịnh v
nh vị
ịtr
trá
ái hay ph
i hay phả
ải c
i củ
ủa 1 Item bên
a 1 Item bên
tr
trá
ái hay ph
i hay phả
ải trên Toolstrip
i trên Toolstrip
Windows Form programming with VB.Net 2005. 8
ToolStripContainer
ToolStripContainer

Windows Form programming with VB.Net 2005. 9
ToolStripContainer
ToolStripContainer
1. Properties:
1. Properties:
-
-Dock:
Dock: đ
đị
ịnh d
nh dạ
ạng hi
ng hiể
ển th
n thị
ịcho Toolstripcontainer
cho Toolstripcontainer
-
-LeftToolStripPanelVisible:
LeftToolStripPanelVisible: True or False
True or False
-
-RightToolStripPanelVisible:
RightToolStripPanelVisible: True or False
True or False
-
-TopToolStripPanelVisible:
TopToolStripPanelVisible: True or False
True or False
-
-BottomToolStripPanelVisible:
BottomToolStripPanelVisible: True or False
True or False
Windows Form programming with VB.Net 2005. 10
StatusStrip
StatusStrip
1.
1. Properties
Properties:
:
-
-Item:
Item: Qu
Quả
ản lý vi
n lý việ
ệc thêm (Add), x
c thêm (Add), xó
óa (remove)
a (remove)
c
cá
ác th
c thà
ành ph
nh phầ
ần c
n củ
ủa StatusStrip
a StatusStrip
-
-TextDirection:
TextDirection: Hi
Hiể
ển th
n thị
ịText c
Text củ
ủa c
a cá
ác th
c thà
ành
nh
ph
phầ
ần c
n củ
ủa StatusStrip theo chi
a StatusStrip theo chiề
ều ngang
u ngang
(
(Horizontal
Horizontal), d
), dọ
ọc theo chi
c theo chiề
ều kim đ
u kim đồ
ồng h
ng hồ
ồ
(
(Vertical90, Vertical270)
Vertical90, Vertical270)…
…
-
-LayoutStyle:
LayoutStyle: X
Xá
ác đ
c đị
ịnh v
nh vị
ịtr
trí
íStatusStrip theo
StatusStrip theo
chu
chuề
ều ngang (
u ngang (Horizontal
Horizontal), d
), dọ
ọc (
c (Vertical
Vertical)
)…
…
-
-RenderMode:
RenderMode: X
Xá
ác đ
c đị
ịnh lo
nh loạ
ại StatusStrip theo
i StatusStrip theo
ch
chế
ế đ
độ
ộSystem,
System, Professional
Professional…
…