473,491 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Save the items of a ListBox every 1 minute

I wrote a program that made some combinations and add them to a listbox, and
i need to save the contents of the listbox every 1 minute...

The method that save the content of the listbox i have already wrote, but
i´m having problems making a timer to save that...

Do you all have an idea how i can do this??
Nov 16 '05 #1
2 2153
You can create a timer that executes every 60000 (interval) milliseconds.
In the tick event, you can call your save method.
HTH
JB
"Drunkalot" <dr*******@terra.com.br> wrote in message
news:ex**************@TK2MSFTNGP09.phx.gbl...
I wrote a program that made some combinations and add them to a listbox, and i need to save the contents of the listbox every 1 minute...

The method that save the content of the listbox i have already wrote, but
i´m having problems making a timer to save that...

Do you all have an idea how i can do this??

Nov 16 '05 #2
Drunkalot wrote:
I wrote a program that made some combinations and add them to a listbox, and
i need to save the contents of the listbox every 1 minute...

The method that save the content of the listbox i have already wrote, but
i´m having problems making a timer to save that...


Hi Drunkalot,

does the Windows.Forms.Timer fit your needs?

private System.Windows.Forms.Timer timer1;

[...]

this.timer1.Interval = 60 * 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);

[...]

private void timer1_Tick(object sender, System.EventArgs e)
{
SaveMyListBox();
}

System.Threading.Timer would be another possibility, perhaps better if
your timer has to tick *exactly* every 60 seconds. The
Windows.Forms-Timer is part of the UI-Message-Queue and may not tick if
your UI is blocked for any reason.

http://msdn.microsoft.com/library/?u...classtopic.asp

Cheers

Arne Janning

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6430
by: Maria | last post by:
How can I display the items in a collection in a listbox? Then, what is the code to remove an item from the collection when the item is selected in the listbox ? Thanks for all help!! Maria
10
21813
by: SueB | last post by:
Hi. Is there a way to "unselect" items in a listbox, programmatically? Here's what I want to do (and I've been trying to to this while debugging the form, but I've been unsuccessful) ... I...
4
3699
by: Ryan Ternier | last post by:
Thanks for the previous help guys! I got my list box issue working, but now i'm trying to loop through all the items in my page. I want to find each listbox, once I do i strip the ID down to...
10
3264
by: Adam Clauss | last post by:
I have a page containing a list box. This list may contain duplicate items - in which the ORDER is important. ex: a b b a is significant as compared to: b
0
1436
by: e | last post by:
My goal is to create a "WindowsXP add/remove programs"-style listbox, where the selected item is bigger (taller) than the others, and displays different content when selected. When the listbox's...
14
18626
by: Paul_Madden via DotNetMonster.com | last post by:
Basically I have a listbox to which I add simple STRING items- I have a progress bar which I increment whenever I populate another portion of the complete set of items I wish to add. What I observe...
0
979
by: sasankasekhar2003 | last post by:
i have a textbox txtName (web form element) 2 listboxes lstAll (web form element) (autopostback=false, select=multiple) lstSel (web form element)(autopostback=false,...
2
1061
by: Evolution445 | last post by:
In my previous topic ( http://www.thescripts.com/forum/thread678765.html ) I thought I finally had the code to work, and it did work, till I added a few other lines of code and then it stopped...
1
1696
by: blintrell | last post by:
<?xml version="1.0" encoding="utf-8"?> <root> <groups> <group gid="1" name="CSM"> <contact cid="1" /> <contact cid="2" /> <contact cid="3" /> <contact cid="4" /> ...
0
6978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7190
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6858
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.