ListBox Items to display Time.

 <asp:ListBox ID="lbxTime" runat="server" Height="40" Width="100" SelectionMode="Multiple">
</asp:ListBox>

private void Popuatelistbox()
{
DateTime dTime = DateTime.Today;
do
{
lbxTime.Items.Add(new ListItem(dTime.ToString("h:mm tt"), dTime.ToString("h:mm tt")));
dTime = dTime.AddMinutes(15);
} while (dTime.Day == DateTime.Today.Day);

}
Ebook Download
View all
Learn
View all