如何制作待办事项清单? [英] How to make a To-Do list ?

查看:126
本文介绍了如何制作待办事项清单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Vb.Net的初学者,正在使用Microsoft Visual Studio2010.因此,我知道如何将文本从文本框传输到标签.但是如何每次都创建新标签,并提供删除任务的选项.

谢谢

I am a beginner at Vb.Net and am using Microsoft Visual Studio 2010. So I know how to transfer the text from a text box to a label. But how do I create new label every time and also give the option of deleting the task.

Thanks

推荐答案

老实说,我根本不会使用标签.
相反,我会看创建表,然后动态填充Page Load事件中的行.
这是我用来组织文件下载的表格-类似的操作:
To be honest, I wouldn''t use labels at all.
I would instead look at creating a table, and dynamically fill in the rows in the Page Load event.
This is the table I use for organizing file downloads - a similar operation:
<table>
    <tr>
        <td>
            <table style="width: 100%;" id="tbDownloads" runat="server">
                <tr>
                    <th>
                        File
                    </th>
                    <th>
                        Version
                    </th>
                    <th>
                        Uploaded on
                    </th>
                </tr>
                <!-- This table is loaded at run time: see page load function -->
            </table>
        </td>
    </tr>
</table>


List<Downloadable> downloads = GetDownloadList();
foreach (Downloadable dl in downloads)
    {
    tbDownloads.Rows.Add(AddDownloadFile(dl));
    }


private static HtmlTableRow AddDownloadFile(Downloadable dl)
    {
    HtmlTableRow row = new HtmlTableRow();
    // File name
    HtmlTableCell cell = new HtmlTableCell();
    cell.InnerHtml = "<a href=\"FileTransferDownload.aspx?file=" + dl.Id + "\" target=\"_blank\">" + dl.FileName + "</a>";
    row.Cells.Add(cell);
    // Version
    cell = new HtmlTableCell();
    cell.InnerText = dl.Version.ToString();
    row.Cells.Add(cell);
    // Upload date
    cell = new HtmlTableCell();
    cell.InnerText = dl.UploadedOn.ToString();
    row.Cells.Add(cell);
    return row;
    }


这使您可以更好地控制正在发生的事情.


This gives you much finer control over what is going on.


这篇关于如何制作待办事项清单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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