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