按钮C#数组 [英] C# Array of Buttons

查看:142
本文介绍了按钮C#数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何建立按钮的阵列中的WinForms应用程序?

How do I build an array of buttons in a Winforms application?

我所试图做的是这样的:我有很多在一种日历安排按钮,所显示时隙。 IE:Monday0700Button,Monday0730Button,Monday0800Button,等在30分钟的时间间隔

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.

我有一个XML数据库,在约会中的一个字段是<时间> 当时间= 0.5hrs,而&LT ;时间> 字段等于07:00,转色Monday0700Button。当持续时间是1.0hrs,我想它来填充Monday0700Button'以及'Monday0730Button'下述时隙按钮。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆