Windows Develop Bookmark and Share   
 index > Windows Forms General > dissapearing subject from listBox
 

dissapearing subject from listBox

I have create a count down code:
DateTime productLaunchDateTime = DateTime.Parse("1/12/2009 12:00:01 AM");
DateTime startDate = DateTime.Now;

//Calculate countdown timer.
TimeSpan t = productLaunchDateTime - startDate;
string countDown = string.Format("{0} Days, {1} Hours, {2} Minutes, {3} Seconds til launch.", t.Days, t.Hours, t.Minutes, t.Seconds);

This code shows for how long would be the Subject visible.
How would I do the code for a particular subject that it would dissapear from the listBox (where this subject is shown) when the count down would come to an end?

I am a newbie at C#, so please don`t be mad if I`ll ask some stupid questions :)
  • Moved byOmegaManMVPWednesday, April 29, 2009 10:00 PM (From:Visual C# General)
  •  
Mitja Bonca  Wednesday, April 29, 2009 8:36 PM
So you just need code to clear a list box?

listBox1.Items.Clear();

This will work as long as the listBox is not bound.

Hope this helps.
www.insteptech.com
DeborahK  Wednesday, April 29, 2009 9:01 PM
You can use the Remove method for removing items from ListBox.


ListBox.Items.Remove("Subject1");

Thanks, A.m.a.L | [Remember to click "mark as answered" when you get a correct reply to your question]
A.m.a.L - aditi.com - Think Product  Thursday, April 30, 2009 5:38 AM
So you just need code to clear a list box?

listBox1.Items.Clear();

This will work as long as the listBox is not bound.

Hope this helps.
www.insteptech.com
DeborahK  Wednesday, April 29, 2009 9:01 PM
Is it like you have a list box with list of subjects and their count down?

how are you showing the count down? using timer? If you give more details it will help.
ChronusDOTNet  Thursday, April 30, 2009 5:30 AM
You can use the Remove method for removing items from ListBox.


ListBox.Items.Remove("Subject1");

Thanks, A.m.a.L | [Remember to click "mark as answered" when you get a correct reply to your question]
A.m.a.L - aditi.com - Think Product  Thursday, April 30, 2009 5:38 AM

You can use google to search for other answers

Custom Search

More Threads

• UserControl embedded in IE and Copy/Paste
• ToolTip text is not displayed after a click
• how to return values from form?
• Label's mouse leave event not firing when border changes
• Converting song files in WMP 10
• Use C# usercontrol in MFC
• Alt + Tab current Application
• protection against date/time tempering
• Create list of object...
• Best way to implement zoom and panning on a 2D map