Windows Forms: Harnessing The Windows Forms: Harnessing The Power And Flexibility Of Windows Power And Flexibility Of Windows Forms 2.0Forms 2.0
Erick EllisErick EllisPRS402PRS402Program Manager Program Manager .NET Client.NET ClientMicrosoft CorporationMicrosoft Corporation
AgendaAgenda
ToolStripsToolStripsCustom renderers, colors, itemsCustom renderers, colors, items
DataGridViewDataGridViewCustom painting, formatting, column Custom painting, formatting, column typestypes
BackgroundWorkerBackgroundWorkerCancellation, progress updates, Cancellation, progress updates, responsive UIresponsive UI
TableLayoutPanelTableLayoutPanelDynamic layout, contentDynamic layout, content
QuestionsQuestions
ToolStripsToolStrips
Replaces MainMenu, ContextMenu, Replaces MainMenu, ContextMenu, ToolBar and StatusBarToolBar and StatusBar
HWNDless architecture HWNDless architecture
Same OM across all containersSame OM across all containers
System and professional renderersSystem and professional renderers
ToolStripControlHostToolStripControlHost
ToolstripsToolstrips
Custom Color TablesCustom Color TablesCustom RenderersCustom RenderersCustom ToolStripItemCustom ToolStripItem
DatagridviewDatagridview
Replaces DataGridReplaces DataGrid
Extensible and FlexibleExtensible and FlexibleBound, Unbound, Virtual, MixedBound, Unbound, Virtual, Mixed
Eleventy billion PMEsEleventy billion PMEs
Text, Image, Button, Link cells/columnsText, Image, Button, Link cells/columns
Cell-based, not Column-basedCell-based, not Column-basedCell styles (Font, Color, Formatting)Cell styles (Font, Color, Formatting)
Cell-level eventsCell-level eventsMouse, Formatting, Validate, Error, others...Mouse, Formatting, Validate, Error, others...
Custom Column TypesCustom Column Types
High performanceHigh performanceDisplay, scrolling, updatesDisplay, scrolling, updates
DataGridViewDataGridView
Custom Styles and ColorsCustom Styles and Colors Custom FormattingCustom Formatting Custom PaintingCustom Painting Custom Column TypesCustom Column Types
BackgroundworkerBackgroundworker
BackgroundWorkerBackgroundWorkerSimplify creating responsive applicationsSimplify creating responsive applications
Easier to perform long running tasks without Easier to perform long running tasks without “freezing” the UI“freezing” the UI
Simplify Thread use in Windows Forms Simplify Thread use in Windows Forms applicationsapplications
Automatically acquired ThreadPool Thread
no UI updates allowed…
UI Thread
DoWork(){DoWork(){ If (!CancellationPending){If (!CancellationPending){ FindInFiles()FindInFiles() }}}}
StartFindInFiles()StartFindInFiles()
ProgressChanged(){ProgressChanged(){ Update UIUpdate UI}}
RunWorkerCompleted()RunWorkerCompleted()
EndFindInFiles()EndFindInFiles()
RunWorkerAsync()RunWorkerAsync()
ReportProgress()ReportProgress()
Diagram: Diagram: BackgroundWorkerBackgroundWorker
TablelayoutpanelTablelayoutpanel
Layout ControlsLayout ControlsTableLayoutPanelTableLayoutPanel
Similar to HTML Table controlSimilar to HTML Table control
Address localization scenariosAddress localization scenarios
Facilitate creation of resizable UIFacilitate creation of resizable UI
Support data-driven UI (e.g., labels from a Support data-driven UI (e.g., labels from a DB)DB)
TableLayoutPanelTableLayoutPanel
AnchorAnchor AutoSize/AutoSizeModeAutoSize/AutoSizeMode Column & Row StylesColumn & Row Styles
Diagram: Login DialogDiagram: Login Dialog
Equal %, preserve Equal %, preserve minimum size, lower minimum size, lower
right alignmentright alignment
Only occupy Only occupy necessary necessary
spacespace
Right aligned, Right aligned, Grow/Shrink to Grow/Shrink to
accommodate label accommodate label lengthlength
AutoScaleAutoScale
RightToLeftRightToLeft
Font ChangesFont Changes
DPI ChangesDPI Changes
SummarySummary
Windows Forms in Visual Studio 2005Windows Forms in Visual Studio 2005make it easier to build professionalmake it easier to build professionallooking, professional looking, professional behavingbehaving applications.applications.
Install Visual Studio 2005 TodayInstall Visual Studio 2005 Todayhttp://lab.msdn.microsoft.com/vs2005http://lab.msdn.microsoft.com/vs2005/Default.aspx/Default.aspx
Resources: Windows Resources: Windows FormsForms
Smart Client on MSDNSmart Client on MSDNhttp://msdn.microsoft.com/smartclienthttp://msdn.microsoft.com/smartclienthttp://msdn.microsoft.com/smartclient/understanding/windohttp://msdn.microsoft.com/smartclient/understanding/windowsformswsformshttp://msdn.microsoft.com/smartclient/community/wffaq/wf2http://msdn.microsoft.com/smartclient/community/wffaq/wf20.aspx0.aspx
Windows Forms Web siteWindows Forms Web sitehttp://www.windowsforms.nethttp://www.windowsforms.net
Beta 1 SamplesBeta 1 Sampleshttp://www.windowsforms.net/Default.aspx?http://www.windowsforms.net/Default.aspx?tabindex=4&tabid=49#Whidbey%20Beta%201tabindex=4&tabid=49#Whidbey%20Beta%201
Online Discussion ForumsOnline Discussion Forumshttp://forums.microsoft.com/msdn/default.aspx?http://forums.microsoft.com/msdn/default.aspx?ForumGroupID=2ForumGroupID=2http://msdn.microsoft.com/smartclient/community/http://msdn.microsoft.com/smartclient/community/discussionsdiscussions/default.aspx /default.aspx
Community ResourcesCommunity ResourcesAt PDCAt PDC
For more information, go seeFor more information, go seePRS402 Windows Forms: Harnessing the Power and Flexibility of PRS402 Windows Forms: Harnessing the Power and Flexibility of Windows Forms 2.0 (Tue 1:00 and 4:15pm)Windows Forms 2.0 (Tue 1:00 and 4:15pm)PRS407 Windows Forms: Occasionally Connected Smart Clients (Wed PRS407 Windows Forms: Occasionally Connected Smart Clients (Wed 11:00 am)11:00 am)PRS321 Windows Forms: Integrating Windows Forms and Windows PRS321 Windows Forms: Integrating Windows Forms and Windows Presentation Foundation ("Avalon") (Thur 11:30am)Presentation Foundation ("Avalon") (Thur 11:30am)FUN222 Windows Vista: What’s New in Software Installation for FUN222 Windows Vista: What’s New in Software Installation for Windows Vista: Exploring the Windows Installer (MSI) and ClickOnce Windows Vista: Exploring the Windows Installer (MSI) and ClickOnce Options (Fri 1:00 pm)Options (Fri 1:00 pm)LabsLabs
FUNHOL15 ClickOnce Deployment FUNHOL15 ClickOnce Deployment PRSHOL17 New UI Features in Windows Forms PRSHOL17 New UI Features in Windows Forms PRSHOL18 New Data Features in Windows Forms PRSHOL18 New Data Features in Windows Forms PRSHOL19 Windows Forms: Advanced Layout PRSHOL19 Windows Forms: Advanced Layout
Ask The ExpertsAsk The Experts
After PDCAfter PDCMSDN dev center: http://msdn.microsoft.com/windowsforms/MSDN dev center: http://msdn.microsoft.com/windowsforms/MSDN Forums: http://forums.microsoft.com/msdn/default.aspx?MSDN Forums: http://forums.microsoft.com/msdn/default.aspx?ForumGroupID=2 ForumGroupID=2