我可以向 checkListBox 添加一个名称 +日期 ? (c#)
好的,最后一次尝试:) 我有一个小表格,用户必须在单击“发送”时填写(姓名、日期等) 我希望他的名字和日期(用户以 DateTimePicker 格式输入日期)将在 CheckedListBox 中显示为 1 项(示例 =“gil 17/12/2011”) 有可能吗?
ok , last try :)
i have a small form that a user have to fill(name, date, etc), when he click "send"
i want that his name together with the date (the user entring the date in DateTimePicker format)will show up in the CheckedListBox as 1 item (example="gil 17/12/2011")
is it possible at all ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当然可以。这里的技巧是要知道 ListBox(和 CheckedListBox)包含一个
Object
列表。它使用这些对象的ToString
方法来显示。您所要做的就是用您自己的类型填充列表,该类型具有ToString
覆盖。Sure you can. The trick here is to know that ListBox (and CheckedListBox) contain a list of
Object
s. It uses theToString
method of those objects to display. All you have to do is populate the list with your own type which has aToString
override.不付出一些努力,不,这是不可能的,但是你可以自己实现。看看 可编辑 ListView 和 ListView 子项的就地编辑。
Without some effort, No, it's not possible, but you can implement that by yourself. Have a look at Editable ListView and In-place editing of ListView subitems.