如何创建一个C#数组按钮? [英] How do I create a C# Array of Buttons?
问题描述
我想要做的是这样的:我有很多按钮在一种日历安排,这是指示时间段。 IE:Monday0700Button,Monday0730Button,Monday0800Button,等等,间隔30min。
我有一个xml数据库,约会的一个字段是 < Duration>
当持续时间= 0.5小时,并且< Time>
字段等于07:00 am时,为'Monday0700Button 。当持续时间为1.0小时时,我希望它填充'Monday0700Button'以及'Monday0730Button'的以下时间段按钮。
任何想法?
Thanks。
是的,您可以建立如下的按钮列表。
列表<按钮> listOfButtons = new List< Button>();
listOfButtons.Add(yourButton);
How do I build an array of buttons in a Winforms application?
What I am trying to do is this: I have a lot of buttons in a sort of calendar arrangement, that are indicating time slots. IE: Monday0700Button, Monday0730Button, Monday0800Button, and so on in 30min intervals.
I have a xml database, where one of the fields for appointments is <Duration>
When the duration = 0.5hrs, and the <Time>
field equals "07:00am", to color the 'Monday0700Button'. When the Duration is 1.0hrs, I want it to populate 'Monday0700Button' as well as the following time slot button of 'Monday0730Button'.
Any ideas? Thanks.
Yes, you can build a list of buttons like below.
List<Button> listOfButtons = new List<Button>();
listOfButtons.Add(yourButton);
这篇关于如何创建一个C#数组按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!