ListBox 类
程序集:
Microsoft.VisualBasic.Compatibility.dll
注意
Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only.http://go.microsoft.com/fwlink/?linkid=160862
运行时显示目录和路径。Displays directories and paths at run time.
public ref class DirListBox : System::Windows::Forms::ListBoxpublic class DirListBox : System.Windows.Forms.ListBox[System.Obsolete("Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only. http://go.microsoft.com/fwlink/?linkid=160862")] public class DirListBox : System.Windows.Forms.ListBoxtype DirListBox = class inherit ListBox[] type DirListBox = class inherit ListBoxPublic Class DirListBox Inherits ListBox
继承

注解

使用此控件显示目录的层次结构列表。Use this control to display a hierarchical list of directories.例如,您可以创建对话框,以使用户能够从所有可用目录的文件列表中打开文件。You can create dialog boxes that, for example, enable a user to open a file from a list of files in all available directories.
备注
Microsoft.VisualBasic.Compatibility.VB6 命名空间中的函数和对象用于工具从 Visual Basic 6.0 升级到 Visual Basic。Functions and objects in theMicrosoft.VisualBasic.Compatibility.VB6 namespace are provided for use by the tools for upgrading from Visual Basic 6.0 to Visual Basic.多数情况下,这些函数和对象可再现 .NET Framework 中其他命名空间的功能。In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the .NET Framework.只有当 Visual Basic 6.0 代码模型与 .NET Framework 实现有显著区别时,才必须使用这些函数和对象。They are necessary only when the Visual Basic 6.0 code model differs significantly from the .NET Framework implementation.

构造函数

指定在搜索过程中没有找到匹配项。Specifies that no matches are found during a search.
(继承自ListBox)

属性

获取或设置控件的默认操作说明以供具有辅助功能的客户端应用程序使用。Gets or sets the default action description of the control for use by accessibility client applications.
(继承自Control)
获取或设置辅助功能客户端应用程序使用的控件说明。Gets or sets the description of the control used by accessibility client applications.
(继承自Control)
获取或设置辅助功能客户端应用程序所使用的控件名称。Gets or sets the name of the control used by accessibility client applications.
(继承自Control)
获取或设置控件的辅助性角色。Gets or sets the accessible role of the control.
(继承自Control)
获取或设置一个值,该值指示控件是否可以接受用户拖放到它上面的数据。Gets or sets a value indicating whether the control can accept data that the user drags onto it.
(继承自Control)
获取一个值,该值指示ListBox 当前是否启用了列表项的选择。Gets a value indicating whether theListBox currently enables selection of list items.
(继承自ListBox)
获取或设置控件绑定到的容器的边缘并确定控件如何随其父级一起调整大小。Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent.
(继承自Control)
此属性与此类无关。This property is not relevant for this class.
(继承自Control)
获取或设置控件的背景色。Gets or sets the background color for the control.
(继承自ListBox)
此属性与此类无关。This property is not relevant to this class.
(继承自ListBox)
获取控件下边缘与其容器的工作区上边缘之间的距离(以像素为单位)。Gets the distance, in pixels, between the bottom edge of the control and the top edge of its container's client area.
(继承自Control)
获取或设置控件(包括其非工作区元素)相对于其父控件的大小和位置(以像素为单位)。Gets or sets the size and location of the control including its nonclient elements, in pixels, relative to the parent control.
(继承自Control)
获取一个用以指示是否可以将ImeMode 属性设置为活动值的值,以启用 IME 支持。Gets a value indicating whether theImeMode property can be set to an active value, to enable IME support.
(继承自Control)
获取一个值,该值指示控件是否可以接收焦点。Gets a value indicating whether the control can receive focus.
(继承自Control)
确定是否可以在控件上引发事件。Determines if events can be raised on the control.
(继承自Control)
获取一个值,该值指示是否可以选中控件。Gets a value indicating whether the control can be selected.
(继承自Control)
获取或设置一个值,该值指示控件是否已捕获鼠标。Gets or sets a value indicating whether the control has captured the mouse.
(继承自Control)
获取或设置一个值,该值指示控件是否会引起在任何需要在接收焦点时执行验证的控件上执行验证。Gets or sets a value indicating whether the control causes validation to be performed on any controls that require validation when it receives focus.
(继承自Control)
获取表示控件的工作区的矩形。Gets the rectangle that represents the client area of the control.
(继承自Control)
获取或设置控件的工作区的高度和宽度。Gets or sets the height and width of the client area of the control.
(继承自Control)
获取或设置多列ListBox 中列的宽度。Gets or sets the width of columns in a multicolumnListBox.
获取包含控件的应用程序的公司名称或创建者。Gets the name of the company or creator of the application containing the control.
(继承自Control)
获取一个值,该值指示控件或它的一个子控件当前是否有输入焦点。Gets a value indicating whether the control, or one of its child controls, currently has the input focus.
(继承自Control)
获取或设置与控件关联的快捷菜单。Gets or sets the shortcut menu associated with the control.
(继承自Control)
获取包含在控件内的控件的集合。Gets the collection of controls contained within the control.
(继承自Control)
获取一个值,该值指示控件是否已经创建。Gets a value indicating whether the control has been created.
(继承自Control)
获取创建控件句柄时所需要的创建参数。Gets the required creation parameters when the control handle is created.
(继承自ListBox)
获取或设置当鼠标指针位于控件上时显示的光标。Gets or sets the cursor that is displayed when the mouse pointer is over the control.
(继承自Control)
为该控件获取数据绑定。Gets the data bindings for the control.
(继承自Control)
获取或设置控件的默认光标。Gets or sets the default cursor for the control.
(继承自Control)
获取控件支持的默认输入法编辑器 (IME) 模式。Gets the default Input Method Editor (IME) mode supported by the control.
(继承自Control)
获取控件之间默认指定的间距(以像素为单位)。Gets the space, in pixels, that is specified by default between controls.
(继承自Control)
获取以像素为单位的长度和高度,此长度和高度被指定为控件的默认最大大小。Gets the length and height, in pixels, that is specified as the default maximum size of a control.
(继承自Control)
获取以像素为单位的长度和高度,此长度和高度被指定为控件的默认最小大小。Gets the length and height, in pixels, that is specified as the default minimum size of a control.
(继承自Control)
获取控件内容的内部间距(以像素为单位)。Gets the internal spacing, in pixels, of the contents of a control.
(继承自Control)
获取控件的默认大小。Gets the default size of the control.
(继承自ListBox)
获取显示当前控件的显示设备的 DPI 值。Gets the DPI value for the display device where the control is currently being displayed.
(继承自Control)
获取或设置DirListBox 控件中当前选定项的索引。Gets or sets the index of the currently selected item in aDirListBox control.
获取表示控件的显示区域的矩形。Gets the rectangle that represents the display area of the control.
(继承自Control)
获取一个值,该值指示Control 基类是否在释放进程中。Gets a value indicating whether the baseControl class is in the process of disposing.
(继承自Control)
获取或设置哪些控件边框停靠到其父控件并确定控件如何随其父级一起调整大小。Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent.
(继承自Control)
获取或设置一个值,该值指示此控件是否应使用辅助缓冲区重绘其图面,以减少或避免闪烁。Gets or sets a value indicating whether this control should redraw its surface using a secondary buffer to reduce or prevent flicker.
(继承自Control)
获取或设置一个值,该值指示控件是否可以对用户交互作出响应。Gets or sets a value indicating whether the control can respond to user interaction.
(继承自Control)
获取一个值,该值指示控件是否有输入焦点。Gets a value indicating whether the control has input focus.
(继承自Control)
获取或设置控件显示的文字的字体。Gets or sets the font of the text displayed by the control.
(继承自ListBox)
获取或设置控件的字体的高度。Gets or sets the height of the font of the control.
(继承自Control)
获取或设置控件的前景色。Gets or sets the foreground color of the control.
(继承自ListBox)
获取或设置指示显示值的方式的格式说明符字符。Gets or sets the format-specifier characters that indicate how a value is to be displayed.
(继承自ListControl)
获取或设置一个值,该值指示是否将格式设置应用于DisplayMember 的ListControl 属性。Gets or sets a value indicating whether formatting is applied to theDisplayMember property of theListControl.
(继承自ListControl)
获取控件绑定到的窗口句柄。Gets the window handle that the control is bound to.
(继承自Control)
获取一个值,该值指示控件是否包含一个或多个子控件。Gets a value indicating whether the control contains one or more child controls.
(继承自Control)
获取或设置控件的高度。Gets or sets the height of the control.
(继承自Control)
获取或设置ListBox 的水平滚动条可滚动的宽度。Gets or sets the width by which the horizontal scroll bar of aListBox can scroll.
(继承自ListBox)
获取或设置一个值,该值指示是否在控件中显示水平滚动条。Gets or sets a value indicating whether a horizontal scroll bar is displayed in the control.
(继承自ListBox)
获取或设置控件的输入法编辑器 (IME) 模式。Gets or sets the Input Method Editor (IME) mode of the control.
(继承自Control)
获取或设置控件的 IME 模式。Gets or sets the IME mode of a control.
(继承自Control)
获取或设置一个值,该值指示控件是否应调整大小以避免只显示项的局部。Gets or sets a value indicating whether the control should resize to avoid showing partial items.
(继承自ListBox)
获取一个值,该值指示调用方在对控件进行方法调用时是否必须调用 Invoke 方法,因为调用方位于创建控件所在的线程以外的线程中。Gets a value indicating whether the caller must call an invoke method when making method calls to the control because the caller is on a different thread than the one the control was created on.
(继承自Control)
获取或设置一个值,该值指示控件对辅助功能应用程序是否可见。Gets or sets a value indicating whether the control is visible to accessibility applications.
(继承自Control)
获取一个值,该值指示控件是否已经被释放。Gets a value indicating whether the control has been disposed of.
(继承自Control)
获取一个值,该值指示控件是否有与它关联的句柄。Gets a value indicating whether the control has a handle associated with it.
(继承自Control)
获取一个值,该值指示此控件是否为镜像控件。Gets a value indicating whether the control is mirrored.
(继承自Control)
获取控件的布局引擎的缓存实例。Gets a cached instance of the control's layout engine.
(继承自Control)
获取或设置控件左边缘与其容器的工作区左边缘之间的距离(以像素为单位)。Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area.
(继承自Control)
获取或设置该控件的左上角相对于其容器的左上角的坐标。Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container.
(继承自Control)
获取或设置控件之间的空间。Gets or sets the space between controls.
(继承自Control)
获取或设置一个值,该值指示ListBox 是否支持多列。Gets or sets a value that indicates whether aListBox supports multiple columns.
获取或设置控件的名称。Gets or sets the name of the control.
(继承自Control)
此属性与此类无关。This property is not relevant to this class.
(继承自ListBox)
获取或设置控件的父容器。Gets or sets the parent container of the control.
(继承自Control)
获取可以容纳控件的矩形区域的大小。Gets the size of a rectangular area into which the control can fit.
(继承自Control)
获取包含控件的程序集的产品名称。Gets the product name of the assembly containing the control.
(继承自Control)
获取包含控件的程序集的版本。Gets the version of the assembly containing the control.
(继承自Control)
获取一个值,该值指示控件当前是否在重新创建其句柄。Gets a value indicating whether the control is currently re-creating its handle.
(继承自Control)
获取或设置与控件关联的窗口区域。Gets or sets the window region associated with the control.
(继承自Control)
已过时。
此属性现已过时。This property is now obsolete.
(继承自Control)
获取或设置一个值,该值指示控件在调整大小时是否重绘自己。Gets or sets a value indicating whether the control redraws itself when resized.
(继承自Control)
获取控件右边缘与其容器的工作区左边缘之间的距离(以像素为单位)。Gets the distance, in pixels, between the right edge of the control and the left edge of its container's client area.
(继承自Control)
获取或设置一个值,该值指示由控件显示的文本是否从右向左显示。Gets or sets a value indicating whether text displayed by the control is displayed from right to left.
(继承自ListBox)
获取一个值,该值确定子控件的缩放。Gets a value that determines the scaling of child controls.
(继承自Control)
获取或设置一个值,该值指示是否任何时候都显示垂直滚动条。Gets or sets a value indicating whether the vertical scroll bar is shown at all times.
(继承自ListBox)
获取或设置ListBox 中当前选定项的从零开始的索引。Gets or sets the zero-based index of the currently selected item in aListBox.
(继承自ListBox)
获取一个集合,该集合包含ListBox 中所有当前选定项的从零开始的索引。Gets a collection that contains the zero-based indexes of all currently selected items in theListBox.
(继承自ListBox)
获取包含ListBox 中当前选定项的集合。Gets a collection containing the currently selected items in theListBox.
(继承自ListBox)
获取或设置在ListBox 中选择项所用的方法。Gets or sets the method in which items are selected in aListBox.
获取一个值,该值指示控件是否应显示聚焦框。Gets a value indicating whether the control should display focus rectangles.
(继承自Control)
获取一个值,该值指示用户界面是否处于适当的状态以显示或隐藏键盘快捷键。Gets a value indicating whether the user interface is in the appropriate state to show or hide keyboard accelerators.
(继承自Control)
获取或设置控件的站点。Gets or sets the site of the control.
(继承自Control)
获取或设置控件的高度和宽度。Gets or sets the height and width of the control.
(继承自Control)
获取一个值,该值指示DirListBox 中的项是否按字母顺序排序。Gets a value that indicates whether the items in aDirListBox are sorted alphabetically.
获取或设置控件在其容器内的 Tab 键顺序。Gets or sets the tab order of the control within its container.
(继承自Control)
获取或设置一个值,该值指示用户能否使用 Tab 键将焦点放到该控件上。Gets or sets a value indicating whether the user can give the focus to this control using the TAB key.
(继承自Control)
获取或设置包含有关控件的数据的对象。Gets or sets the object that contains data about the control.
(继承自Control)
获取或搜索ListBox 中当前选定项的文本。Gets or searches for the text of the currently selected item in theListBox.
(继承自ListBox)
获取或设置控件上边缘与其容器的工作区上边缘之间的距离(以像素为单位)。Gets or sets the distance, in pixels, between the top edge of the control and the top edge of its container's client area.
(继承自Control)
获取没有另一个 Windows 窗体控件作为其父级的父控件。Gets the parent control that is not parented by another Windows Forms control.通常,这是控件所在的最外面的Form。Typically, this is the outermostForm that the control is contained in.
(继承自Control)
获取或设置一个值,它指示ListBox 在通过使用CustomTabOffsets 整数数组绘制字符串时是否识别并展开制表符。Gets or sets a value indicating whether theListBox recognizes and expands tab characters when it draws its strings by using theCustomTabOffsets integer array.
(继承自ListBox)
获取或设置一个值,该值指示ListBox 在绘制其字符串时是否可识别和展开制表符。Gets or sets a value indicating whether theListBox can recognize and expand tab characters when drawing its strings.
(继承自ListBox)
获取或设置一个值,该值指示是否将等待光标用于当前控件以及所有子控件。Gets or sets a value indicating whether to use the wait cursor for the current control and all child controls.
(继承自Control)
获取或设置一个属性,该属性将用作ListControl 中项的实际值。Gets or sets the property to use as the actual value for the items in aListControl.
获取或设置一个值,该值指示是否显示该控件及其所有子控件。Gets or sets a value indicating whether the control and all its child controls are displayed.
(继承自Control)
获取或设置控件的宽度。Gets or sets the width of the control.
(继承自Control)
此属性与此类无关。This property is not relevant for this class.
(继承自Control)

方法

已过时。
此成员已过时,且无替代项。This member is obsolete, and there is no replacement.
(继承自ListBox)
在创建控件的基础句柄所在线程上异步执行指定委托。Executes the specified delegate asynchronously on the thread that the control's underlying handle was created on.
(继承自Control)
在创建控件的基础句柄所在线程上,用指定的自变量异步执行指定委托。Executes the specified delegate asynchronously with the specified arguments, on the thread that the control's underlying handle was created on.
(继承自Control)
当向ListBox 中一次添加一个项时,通过防止该控件绘图来维护性能,直到调用EndUpdate() 方法为止。Maintains performance while items are added to theListBox one at a time by preventing the control from drawing until theEndUpdate() method is called.
(继承自ListBox)
将控件带到 Z 顺序的前面。Brings the control to the front of the z-order.
(继承自Control)
取消选择ListBox 中的所有项。Unselects all items in theListBox.
(继承自ListBox)
检索一个值,该值指示指定控件是否为一个控件的子控件。Retrieves a value indicating whether the specified control is a child of the control.
(继承自Control)
为该控件新建一个可访问性对象。Creates a new accessibility object for this control.
(继承自ListBox)
强制创建可见控件,包括创建句柄和任何可见子控件。Forces the creation of the visible control, including the creation of the handle and any visible child controls.
(继承自Control)
为控件创建控件集合的新实例。Creates a new instance of the control collection for the control.
(继承自Control)
为该控件创建句柄。Creates a handle for the control.
(继承自Control)
创建项集合的新实例。Creates a new instance of the item collection.
(继承自ListBox)
创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(继承自MarshalByRefObject)
向默认窗口过程发送指定消息。Sends the specified message to the default window procedure.
(继承自Control)
毁坏与该控件关联的句柄。Destroys the handle associated with the control.
(继承自Control)
释放DirListBox 控件使用的非托管资源,还可以选择释放托管资源。Releases the unmanaged resources that are used by aDirListBox control and optionally releases the managed resources.
开始拖放操作。Begins a drag-and-drop operation.
(继承自Control)
支持对指定位图的呈现。Supports rendering to the specified bitmap.
(继承自Control)
检索由传递的IAsyncResult 表示的异步操作的返回值。Retrieves the return value of the asynchronous operation represented by theIAsyncResult passed.
(继承自Control)
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.
(继承自Object)
如果ListControl 项是被给定了该项以及属性名称的对象的属性,则返回该项的当前值。Returns the current value of theListControl item, if it is a property of an object given the item and the property name.
(继承自ListControl)
检索控件所在的窗体。Retrieves the form that the control is on.
(继承自Control)
查找ListBox 中以指定字符串开始的第一个项。Finds the first item in theListBox that starts with the specified string.
(继承自ListBox)
查找ListBox 中以指定字符串开始的第一个项。Finds the first item in theListBox that starts with the specified string.搜索从特定的起始索引处开始。The search starts at a specific starting index.
(继承自ListBox)
查找ListBox 中第一个精确匹配指定字符串的项。Finds the first item in theListBox that exactly matches the specified string.
(继承自ListBox)
查找ListBox 中第一个精确匹配指定字符串的项。Finds the first item in theListBox that exactly matches the specified string.搜索从特定的起始索引处开始。The search starts at a specific starting index.
(继承自ListBox)
为控件设置输入焦点。Sets input focus to the control.
(继承自Control)
检索一个值,该值指示当启用控件的AutoSize 属性时控件的行为方式。Retrieves a value indicating how a control will behave when itsAutoSize property is enabled.
(继承自Control)
检索位于指定坐标处的子控件。Retrieves the child control that is located at the specified coordinates.
(继承自Control)
检索位于指定坐标的子控件,并且指定是否忽略特定类型的子控件。Retrieves the child control that is located at the specified coordinates, specifying whether to ignore child controls of a certain type.
(继承自Control)
作为默认哈希函数。Serves as the default hash function.
(继承自Object)
返回指定项的文本表示形式。Returns the text representation of the specified item.
(继承自ListControl)
已过时。
检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(继承自MarshalByRefObject)
按照子控件的 Tab 键顺序向前或向后检索下一个控件。Retrieves the next control forward or back in the tab order of child controls.
(继承自Control)
检索适合控件的矩形区域的大小。Retrieves the size of a rectangular area into which a control can be fitted.
(继承自Control)
返回一个值,该值指示是否选定了指定的项。Returns a value indicating whether the specified item is selected.
(继承自ListBox)
为控件检索指定控件样式位的值。Retrieves the value of the specified control style bit for the control.
(继承自Control)
确定控件是否是顶级控件。Determines if the control is a top-level control.
(继承自Control)
对用户隐藏控件。Conceals the control from the user.
(继承自Control)
返回指定坐标处的项的从零开始的索引。Returns the zero-based index of the item at the specified coordinates.
(继承自ListBox)
返回指定坐标处的项的从零开始的索引。Returns the zero-based index of the item at the specified coordinates.
(继承自ListBox)
已过时。
获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance.
(继承自MarshalByRefObject)
在将控件添加到另一个容器之后调用。Called after the control has been added to another container.
(继承自Control)
使控件的整个图面无效并导致重绘控件。Invalidates the entire surface of the control and causes the control to be redrawn.
(继承自Control)
使控件的特定区域无效并向控件发送绘制消息。Invalidates a specific region of the control and causes a paint message to be sent to the control.还可以使分配给该控件的子控件无效。Optionally, invalidates the child controls assigned to the control.
(继承自Control)
使控件的指定区域无效(将其添加到控件的更新区域,下次绘制操作时将重新绘制更新区域),并向控件发送绘制消息。Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control.
(继承自Control)
使控件的指定区域无效(将其添加到控件的更新区域,下次绘制操作时将重新绘制更新区域),并向控件发送绘制消息。Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control.还可以使分配给该控件的子控件无效。Optionally, invalidates the child controls assigned to the control.
(继承自Control)
使控件的指定区域无效(将其添加到控件的更新区域,下次绘制操作时将重新绘制更新区域),并向控件发送绘制消息。