Click here to Skip to main content
15,888,521 members
Home / Discussions / C#
   

C#

 
AnswerRe: Anybody familiar with compression? (Using it I mean) Pin
Luc Pattyn8-Feb-12 12:12
sitebuilderLuc Pattyn8-Feb-12 12:12 
GeneralRe: Anybody familiar with compression? (Using it I mean) Pin
SledgeHammer018-Feb-12 13:08
SledgeHammer018-Feb-12 13:08 
GeneralRe: Anybody familiar with compression? (Using it I mean) Pin
SledgeHammer018-Feb-12 13:56
SledgeHammer018-Feb-12 13:56 
AnswerRe: Anybody familiar with compression? (Using it I mean) Pin
Luc Pattyn9-Feb-12 4:33
sitebuilderLuc Pattyn9-Feb-12 4:33 
AnswerRe: Anybody familiar with compression? (Using it I mean) Pin
Luc Pattyn8-Feb-12 10:39
sitebuilderLuc Pattyn8-Feb-12 10:39 
QuestionUsing Controls in multiple threads Pin
Danzy838-Feb-12 7:47
Danzy838-Feb-12 7:47 
AnswerRe: Using Controls in multiple threads Pin
Luc Pattyn8-Feb-12 8:21
sitebuilderLuc Pattyn8-Feb-12 8:21 
AnswerRe: Using Controls in multiple threads Pin
DaveyM698-Feb-12 8:43
professionalDaveyM698-Feb-12 8:43 
Not sure what you're doing wrong - but plainly something!
This test code works and adds "mathematics" to the ListView twice, once from the UI thread and once from another thread by calling Invoke on the ListView:
C#
using System.Threading;
using System.Windows.Forms;


    public delegate void AddSubjectDelegate(ListViewItem item);

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            StartAddItem();
            new ThreadStart(StartThread).BeginInvoke(null, null);
        }
        private void StartThread()
        {
            StartAddItem();
        }
        private void StartAddItem()
        {
            ListViewItem listItem = new ListViewItem("mathematics");
            AddSubjectDelegate addSubject = new AddSubjectDelegate(AddListItem);
            if (lvSubjects.InvokeRequired)
            {
                lvSubjects.Invoke(addSubject, listItem);
            }
            else
                addSubject(listItem);
        }
        private void AddListItem(ListViewItem item)
        {
            lvSubjects.Items.Add(item);
        }
    }

Dave

Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.
Astonish us. Be exceptional. (Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)



QuestionThe type or namespace name 'Excel' could not be found Pin
pmcm8-Feb-12 5:17
pmcm8-Feb-12 5:17 
AnswerRe: The type or namespace name 'Excel' could not be found Pin
Wes Aday8-Feb-12 5:24
professionalWes Aday8-Feb-12 5:24 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
pmcm8-Feb-12 5:31
pmcm8-Feb-12 5:31 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
Richard MacCutchan8-Feb-12 6:25
mveRichard MacCutchan8-Feb-12 6:25 
AnswerRe: The type or namespace name 'Excel' could not be found Pin
Eddy Vluggen8-Feb-12 9:12
professionalEddy Vluggen8-Feb-12 9:12 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
Richard MacCutchan8-Feb-12 21:41
mveRichard MacCutchan8-Feb-12 21:41 
AnswerRe: The type or namespace name 'Excel' could not be found Pin
Eddy Vluggen9-Feb-12 0:17
professionalEddy Vluggen9-Feb-12 0:17 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
Richard MacCutchan9-Feb-12 0:58
mveRichard MacCutchan9-Feb-12 0:58 
AnswerRe: The type or namespace name 'Excel' could not be found Pin
Eddy Vluggen9-Feb-12 4:59
professionalEddy Vluggen9-Feb-12 4:59 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
Richard MacCutchan9-Feb-12 6:21
mveRichard MacCutchan9-Feb-12 6:21 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
Eddy Vluggen9-Feb-12 6:45
professionalEddy Vluggen9-Feb-12 6:45 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
Richard MacCutchan9-Feb-12 6:52
mveRichard MacCutchan9-Feb-12 6:52 
AnswerRe: The type or namespace name 'Excel' could not be found Pin
Luc Pattyn8-Feb-12 6:42
sitebuilderLuc Pattyn8-Feb-12 6:42 
AnswerRe: The type or namespace name 'Excel' could not be found Pin
Dinesh928-Feb-12 20:31
professionalDinesh928-Feb-12 20:31 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
pmcm8-Feb-12 21:46
pmcm8-Feb-12 21:46 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
Richard MacCutchan9-Feb-12 6:28
mveRichard MacCutchan9-Feb-12 6:28 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
pmcm10-Feb-12 4:13
pmcm10-Feb-12 4:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.