CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2003
    Location
    Australia
    Posts
    58

    i wonder it is a problem?

    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?

  2. #2
    Join Date
    Dec 2000
    Location
    Slovakia
    Posts
    1,043
    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

  3. #3
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    for displaying data records I would suggest use datagrid on which extensive research has already done ...

    paresh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured