Share via


Windows 窗体演练

演练针对常见方案提供了分步说明。 这使它们成为了解特定功能部分的良好开端。

本主题包含指向 Windows 窗体编程演练的链接。

演练

区域

标题

入门演练

演练:创建简单的 Windows 窗体

演练:Windows 窗体设计器入门

演练:创建可根据数据输入需要调整大小的 Windows 窗体

布局演练

演练:使用对齐线在 Windows 窗体上排列控件

演练:使用 Padding、Margins 和 AutoSize 属性对 Windows 窗体控件进行布局

演练:使用 FlowLayoutPanel 在 Windows 窗体上排列控件

演练:使用 TableLayoutPanel 在 Windows 窗体上排列控件

控制演练

演练:使用自定义组件自动填充工具箱

演练:在后台运行操作

演练:实现一个使用后台操作的窗体

演练:使用设计器创建带有 ListView 和 TreeView 控件的资源管理器样式的界面

演练:使用 MaskedTextBox 控件

演练:向窗体提供标准菜单项

演练:在运行时更新状态栏信息

演练:创建具有菜单合并功能和 ToolStrip 控件的 MDI 窗体

演练:创建具有专业样式的 ToolStrip 控件

DataGridView 控制演练

演练:创建未绑定的 Windows 窗体 DataGridView 控件

演练:使用两个 Windows 窗体 DataGridView 控件创建一个主/从窗体

演练:验证 Windows 窗体 DataGridView 控件中的数据

演练:处理在 Windows 窗体 DataGridView 控件中输入数据时发生的错误

演练:在 Windows 窗体 DataGridView 控件中实现虚拟模式

开发控制演练

演练:使用 Visual Basic 创作复合控件

演练:使用 Visual C# 创作复合控件

演练:使用 Visual Basic 从 Windows 窗体控件继承

演练:使用 Visual C# 从 Windows 窗体控件继承

演练:使用 Windows 窗体控件上的智能标记执行常规任务

演练:使用 DesignerSerializationVisibilityAttribute 序列化标准类型的集合

演练:设计时调试自定义 Windows 窗体控件

演练:创建一个利用 Visual Studio 设计时功能的 Windows 窗体控件

对话框演练

演练:使用对象整体检索对话框信息

拖放演练

演练:在 Windows 窗体中执行拖放操作

全球化演练

演练:本地化 Windows 窗体

演练:创建可根据本地化需要调整比例的布局

演练:在设计器中使用 ClickOnce 部署 API 按需下载附属程序集

COM 互操作演练

演练:在每个 Windows 窗体各自的线程上显示该 Windows 窗体自身以支持 COM 互操作

演练:通过在共享线程上显示 Windows 窗体支持 COM 互操作

可视化继承演练

演练:演示可视化继承

可访问性演练

演练:创建可访问的基于 Windows 的应用程序

WPF 控件演练

演练:设计时在 Windows 窗体上排列 WPF 内容

演练:设计时更改承载的 WPF 元素的属性

演练:设计时在 Windows 窗体上创建新的 WPF 内容

演练:将 ElementHost 控件复制并粘贴到单独的 Windows 窗体中

演练:设计时在 Windows 窗体上分配 WPF 内容

演练:设置 WPF 内容的样式

组件演练

演练:用 Visual Basic 创作简单的多线程组件

演练:使用 Visual C# 创作简单的多线程组件

演练:使用 Visual Basic 创作组件

演练:使用 Visual C# 创作组件

请参见

概念

Visual Studio 演练

其他资源

WPF 演练