Click to See Complete Forum and Search --> : i wonder it is a problem?


aspdotnet
March 8th, 2003, 09:19 AM
static void Main()
{
frmMain fm= new frmMain();
Application.Idle += new System.EventHandler(fm.OnIdle);
Application.Run(mf);
}
public void OnIdle(object sender, EventArgs e)
{
ListInfo.Text = _alPostList.Count.ToString();
}

when i was programming i did like above..

i wonder if i did like above ...is there any overworking on the computer...?
sometimes i used to use this code.. but i might not know what this code means.
Is there really any overworking on computer if i use this code?

MartinL
March 10th, 2003, 03:27 AM
That code doesn't mean anything else then counting of ListBox items in idle time of the appliction... The code is executed whenever the application finish processing and it is going to enter the idle state.

No, it doesn't get much "overworking" of the computer and don't worry to use this chunk of code.

However, I don't know if this is the best solution for displaying number of records in the list... I think, would be enough if you set the label everytime you add or delete record in the list...

Martin

pareshgh
March 10th, 2003, 03:53 PM
for displaying data records I would suggest use datagrid on which extensive research has already done ...

paresh