BCB6:如何将表单的元素放入数组中?
我正在 C++Builder6 中构建一个简单的游戏,并且我在 Form 上有 42 个 Image 对象...在启动时我希望禁用所有 Image 对象,所以我想知道我可以将它们全部放入一个数组中吗?简单地循环整个数组并使它们禁用?我知道一定有办法,但我只是编程新手:)
I'm building a simple game in C++Builder6 and I have 42 Image objects on a Form... At start-up I want all Image objects to be disabled, so I wonder can I put all of them in an array and simply loop thorough the entire array and make them Disabled? I know there must be a way, but I'm just new to programming :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您有多种选择。
第一:你可以声明
并动态构造图像。
第二个选项是声明
并手动设置所有值;
然后你将拥有数组中的所有图像,并且可以使用循环对所有图像执行某些操作
You have several options.
First: You can declare
And dynamically construct the image.
Second option is declare
and manually set all values;
Then you will have all image in array and you can use loop for doing something on all Image