请输入您要查询的百科知识:

 

词条 Control array
释义

  1. References

{{orphan|date=February 2016}}

In Visual Basic, a control array[1] is a group of related controls in a Visual Basic form that share the same event handlers. Control arrays are always single-dimensional arrays, and controls can be added or deleted from control arrays at runtime. One application of control arrays is to hold menu items, as the shared event handler can be used for code common to all of the menu items in the control array.[2]

Control arrays are a convenient way to handle groups of controls that perform a similar function. All of the events available to the single control are still available to the array of controls, the only difference being an argument indicating the index of the selected array element is passed to the event. Hence, instead of writing individual procedures for each control (i.e. not using control arrays), you only have to write one procedure for each array.

Control arrays are no longer supported in Visual Basic 2008, as "changes to the event model" made them unnecessary.[1] The Visual Basic Upgrade Wizard can convert code that uses control arrays into Visual Basic 2008 code that uses more recent structures.[3]

References

1. ^http://msdn.microsoft.com/en-us/library/aa289500%28v=vs.71%29.aspx
2. ^{{Cite web|title = vb control array - Control Arrays in Visual Basic 6|url = http://www.freetutes.com/learn-vb6/lesson11.html|website = www.freetutes.com|access-date = 2016-02-12}}
3. ^{{Cite web|title = Upgrading Visual Basic 6.0 Applications to Visual Basic .NET and Visual Basic 2005|url = https://msdn.microsoft.com/en-us/library/ff648898.aspx|website = msdn.microsoft.com|access-date = 2016-02-12}}
{{Programming-software-stub}}

1 : BASIC programming language family

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/21 21:44:42