Click here to Skip to main content
15,921,840 members
Home / Discussions / C#
   

C#

 
AnswerRe: Should I Get Visual Studio 2008? Pin
pmarfleet24-Mar-08 9:30
pmarfleet24-Mar-08 9:30 
GeneralRe: Should I Get Visual Studio 2008? Pin
BlitzPackage24-Mar-08 9:46
BlitzPackage24-Mar-08 9:46 
GeneralRe: Should I Get Visual Studio 2008? Pin
pmarfleet24-Mar-08 10:08
pmarfleet24-Mar-08 10:08 
GeneralRe: Should I Get Visual Studio 2008? Pin
PIEBALDconsult25-Mar-08 5:07
mvePIEBALDconsult25-Mar-08 5:07 
GeneralUsing active port to send TCP packets Pin
Julinnnnnn24-Mar-08 9:09
Julinnnnnn24-Mar-08 9:09 
GeneralCreating Class library (COM object) Pin
pnpfriend24-Mar-08 8:45
pnpfriend24-Mar-08 8:45 
GeneralRe: Creating Class library (COM object) Pin
Christian Graus24-Mar-08 11:13
protectorChristian Graus24-Mar-08 11:13 
GeneralListbox not updating when items are added from another thread. Pin
Jordanwb24-Mar-08 7:49
Jordanwb24-Mar-08 7:49 
I'm making an Instant Messenger using my new knowledge of Sockets. When the client connects to the host, it tells the host its username. If it's okay (not in use), the client asks for the list of online users. The host replies with an array of bytes and it's converted into an array of strings. I checked the values in the array for set. Now since I would get a cross-threaded call exception I used lsb_users.Invoke so that it would execute on the right thread, (see code):

public void AddUsernameToList(string username)<br />
        {<br />
            if (this.lsb_users.InvokeRequired)<br />
            {<br />
                this.lsb_users.Invoke(new MethodInvoker(delegate { AddUsernameToList(username); }));<br />
                return;<br />
            }<br />
            this.lsb_users.Items.Add(username);<br />
        }


I set a breakpoint on "this.lsb_users.Items.Add (username)" and it is adding, I hover over Items and it says there are two (which is correct: host username and client username). However in the form there's nothing in the list. Would there be some reason for the listBox not to update? Also something extra: when a client connects to the host it updates the same listbox on its end and it works just fine.

[Edit]
I have a Room class which extends Form, the Room class has the listbox mentionned above as well as the method mentionned above.

HostRoom extends Room and ClientRoom extends Form so the same method is being called. For some reason in ClientRoom nothing is happening.

[/Edit]
Thanks.
GeneralRe: Listbox not updating when items are added from another thread. Pin
ptr2void24-Mar-08 19:21
ptr2void24-Mar-08 19:21 
GeneralRe: Listbox not updating when items are added from another thread. [modified] Pin
Jordanwb25-Mar-08 2:10
Jordanwb25-Mar-08 2:10 
QuestionHow to compare Date Field Value in Access Database with SystemDate and if matches then display in datagrid Pin
rizwan124-Mar-08 7:49
rizwan124-Mar-08 7:49 
GeneralRe: How to compare Date Field Value in Access Database with SystemDate and if matches then display in datagrid Pin
LongRange.Shooter24-Mar-08 8:00
LongRange.Shooter24-Mar-08 8:00 
QuestionRe: How to compare Date Field Value in Access Database with SystemDate and if matches then display in datagrid Pin
rizwan124-Mar-08 20:55
rizwan124-Mar-08 20:55 
GeneralCreatig ellipse on a picturebox and making ellipse a link Pin
Casper Hansen24-Mar-08 7:18
Casper Hansen24-Mar-08 7:18 
GeneralRe: Creatig ellipse on a picturebox and making ellipse a link Pin
Christian Graus24-Mar-08 10:19
protectorChristian Graus24-Mar-08 10:19 
GeneralRe: Creatig ellipse on a picturebox and making ellipse a link Pin
Casper Hansen26-Mar-08 11:16
Casper Hansen26-Mar-08 11:16 
GeneralRe: Creatig ellipse on a picturebox and making ellipse a link Pin
Christian Graus26-Mar-08 12:31
protectorChristian Graus26-Mar-08 12:31 
GeneralRe: Creatig ellipse on a picturebox and making ellipse a link Pin
Casper Hansen27-Mar-08 3:20
Casper Hansen27-Mar-08 3:20 
GeneralEscape Characters in C# Pin
Vimalsoft(Pty) Ltd24-Mar-08 7:15
professionalVimalsoft(Pty) Ltd24-Mar-08 7:15 
GeneralRe: Escape Characters in C# Pin
m@u24-Mar-08 7:23
m@u24-Mar-08 7:23 
GeneralRe: Escape Characters in C# Pin
Giorgi Dalakishvili24-Mar-08 7:28
mentorGiorgi Dalakishvili24-Mar-08 7:28 
GeneralRe: Escape Characters in C# Pin
Vimalsoft(Pty) Ltd25-Mar-08 1:17
professionalVimalsoft(Pty) Ltd25-Mar-08 1:17 
GeneralRe: Escape Characters in C# Pin
Giorgi Dalakishvili25-Mar-08 7:42
mentorGiorgi Dalakishvili25-Mar-08 7:42 
Questionhow to populate a textboxi in a listview control?? Pin
pyde24-Mar-08 5:41
pyde24-Mar-08 5:41 
AnswerRe: how to populate a textboxi in a listview control?? Pin
pyde26-Mar-08 8:25
pyde26-Mar-08 8:25 

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.