Krzysztof Mossakowski
Windows Programming
2006 - Tasks
Windows Forms: controls
Image viewer
The application (see pic.):
the main window:
menu:
Files - a filter for displayed images
bmp, gif, jpg - checkable menu items
All
Windows
Preview - show preview window
History - show history window
tree with folders
list with files
always show files which are situated in selected folder
displays files according to the setting of file filter
after selecting a file:
show the image
show the image in preview window (if visible)
add a pathname to the history
change information on the status bar
status bar :
full pathname
width and height of the image (in pixels)
preview of the image
always in 1:1 scale
use scroll bars
image preview window - displays the image scaled to the size of the window
history window
a ListView with two columns for the name and path of the file
selecting a file on the history list should set it as current in the main window
Implementation details:
all windows are resizable, controls fill windows
two splitters in the main window
use 4 delegates for and event of current image's change:
image preview in 1:1 scale
status bar
preview window
history window
Hints:
classes, methods, properties:
Directory.GetLogicalDrives, Directory.GetDirectories, Directory.GetFiles
Control.Dock
StatusBar.Panels
TreeView.Nodes, TreeView.AfterSelect
ListBox.Items, ListBox.SelectedIndexChanged
Panel.AutoScroll, Panel.AutoScrollMinSize
PictureBox.SizeMode
ListView.Columns, ListView.Items, ListView.View