博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Winform 2.0中的Strip控件
阅读量:5368 次
发布时间:2019-06-15

本文共 4322 字,大约阅读时间需要 14 分钟。

including MenuStrip, ToolStrip, StatusStrip, and ContextMenuStrip
Figure 9 Strip Controls

The new strip controls improve on MainMenu, ToolBar, StatusBar, and ContextMenu in several key ways, including:

  • A consistent API to all strip controls
  • Improved design-time experience
  • Allowing adjacent strip controls to be repositioned with respect to one another, as well as repositioned to the top, right, bottom, and left of the host form's client area
  • Contemporary look of Office 2003 and Windows themes
  • Ability to host a rich set of child controls, such as dropdown lists, labels, menus, and textboxes
  • Rendering support that simplifies custom painting coding

While MainMenu, ToolBar, StatusBar, and ContextMenu are not included by default in the Visual Studio Toolbox, they are still included in the .NET Framework, primarily for backwards compatibility. Of course, the strip controls are located on the Toolbox so you can easily drag them onto your form. Through the Designer, you can add a variety of controls to each strip control

 Controls Hosted by Strip Control

Strip Control Designer-Allowed Strip Item Controls
MenuStrip ToolStripMenuItem (for both top menu and submenu items)
ToolStripComboBox
ToolStripTextBox
ToolStripSeparator (for submenus)
ContextMenuStrip Same as MenuStrip
ToolStrip ToolStripButton
ToolStripComboBox
ToolStripSplitButton
ToolStripLabel
ToolStripSeparator
ToolStripDropDownButton
ToolStripTextBox
ToolStripProgressBar
StatusStrip ToolStripStatusLabel
ToolStripProgressBar
ToolStripDropDownButton
ToolStripSplitButton
 
Key Strip Control Property Configurations
Property Description
AllowItemReorder Users can reposition strip items by setting this property to True. The user needs to press Alt before repositioning (not for ContextMenuStrip).
ShowItemToolTips Sets whether strip items can also display tool tips (not for MenuStrip or Context MenuStrip).
Dock Specifies the form edge to line the strip control up against or fill.
RenderMode Strip controls support three render modes:
System: rendered with colors from the system palette.
Professional: rendered according to the current Windows Color Scheme—Blue, Olive Green, or Silver.
ManagerRenderMode: rendered using the Windows Theme sensitive ToolStripRenderer and is the default.
Custom is currently unsupported.
SizingGrip Specifies whether the form sizing grip should be shown or hidden (StatusStrip only).
GripStyle Specifies whether a MenuStrip or ToolStrip displays a grip allowing it to be repositioned.
CanOverflow When the form becomes narrower than a strip control, this option specifies how to visually represent strip items that are hidden by the overlap, either hidden if False or accessible via a dropdown at the end of the strip control if True.

 Key Strip Item Control Property Configurations

Property Description
DisplayStyle Specifies what to display; values include None, Text, Image, and ImageAndText.
TextImageRelation Sets the position of text in relation to an image. Applied when DisplayStyle is ImageAndText.
ImageScaling Specifies how an image is rendered, either ShrinkToFit or None.
Alignment Determines which end of a strip control a strip item control will align to, either Head or Tail (Left or Right sides, respectively, when rendering left-to-right).
Overflow Determines how each strip item control responds to overflow. Can be either Never, Always, or AsNeeded, which leaves the decision up to the host strip control.

 Key MaskedTextBox Properties

Property Description
HidePromptOnLeave True by default but, if set to False, ensures that prompt characters are always visible.
PromptChar Used to change the prompt character. Underscore by default.
AllowPromptAsInput In some cases, your prompt character may also be a valid value and setting AllowPromptAsInput to True allows this when neither can be reasonably changed.
IncludeLiterals Specifies whether to include literal character values in MaskedTextBox's Text property.
IncludePrompts Specifies whether to include prompt character values in MaskedTextBox's Text property.
ResetOnPrompt If True, when a prompt is entered, a prompt is inserted and values on the right-hand side are shifted right.
ResetOnSpace If True, when a space is entered, a space is inserted and values on the right-hand side are shifted right.

转载于:https://www.cnblogs.com/chinapro/archive/2005/04/17/139132.html

你可能感兴趣的文章
Data Structure 基本概念
查看>>
[搬运] 写给 C# 开发人员的函数式编程
查看>>
core--线程池
查看>>
他山之石:加载图片的一个小问题
查看>>
shell - 常识
查看>>
Spring Cloud Stream消费失败后的处理策略(三):使用DLQ队列(RabbitMQ)
查看>>
PKUWC2018 5/6
查看>>
As-If-Serial 理解
查看>>
洛谷P1005 矩阵取数游戏
查看>>
在Silverlight中使用HierarchicalDataTemplate为TreeView实现递归树状结构
查看>>
无线通信基础(一):无线网络演进
查看>>
关于python中带下划线的变量和函数 的意义
查看>>
linux清空日志文件内容 (转)
查看>>
MySQL-EXPLAIN执行计划Extra解释
查看>>
图片点击轮播(三)-----2017-04-05
查看>>
直播技术细节3
查看>>
java中new一个对象和对象=null有什么区别
查看>>
字母和数字键的键码值(keyCode)
查看>>
01_1_准备ibatis环境
查看>>
JavaScript中的BOM和DOM
查看>>