| | |
Label not updating
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2004
Posts: 489
Reputation:
Solved Threads: 5
Hey guys,
I've got a multithreaded application done in C# but the label on one of my forms won't update! It doesn't do anything
I don't get why.... it doesn't even get set to "Hello"
I've got a multithreaded application done in C# but the label on one of my forms won't update! It doesn't do anything
C# Syntax (Toggle Plain Text)
public IndividualPCSpec(AllKnownDevicesFrm parent) { m_Parent = parent; InitializeComponent(); m_IPAddressLbl.Text = "HELLO"; } public void showInformation(ComputerHardware dto) { m_IPAddressLbl.Text = "HELLO WORLD"; this.Refresh(); this.m_IPAddressLbl.Refresh(); Application.DoEvents(); }
I don't get why.... it doesn't even get set to "Hello"
•
•
Join Date: Dec 2004
Posts: 489
Reputation:
Solved Threads: 5
from another class.
C# Syntax (Toggle Plain Text)
Class X IndividualPCSpec m_individualPC = new IndividualPCSpec (this); ComputerHardware dto = new ComputerHardware(...); .. .. Function X() { showInformation(dto); } }
Normally updating labels in a form is not a thread-safe operation. Check this article out:
http://msdn.microsoft.com/en-us/libr...28(VS.80).aspx
That may give you a good idea of what you have to do to update the label. You need to invoke another method to update the label's text. I'm surprised an exception is not being thrown...
http://msdn.microsoft.com/en-us/libr...28(VS.80).aspx
That may give you a good idea of what you have to do to update the label. You need to invoke another method to update the label's text. I'm surprised an exception is not being thrown...
Alex Cavnar, aka alc6379
![]() |
Similar Threads
- updating jlabel (Java)
- updating a gridview row in web application (VB.NET)
- problem in updating the gridview (ASP.NET)
- Help with GUI. Updating between 2 forms. (C#)
- Problem updating a JLabel?? (Java)
- updating text fields in GUIs (Java)
- Updating Combo Box (Visual Basic 4 / 5 / 6)
- ASP.Net VB Page to update a users profile not updating. (MS SQL)
- Updating Controls (C++)
Other Threads in the C# Forum
- Previous Thread: problem transfering data from one form to another
- Next Thread: Trouble with dataGridViewButtonColumn event
| Thread Tools | Search this Thread |
.net access algorithm array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom customactiondata database datagrid datagridview dataset datastructure date/time datetime datetimepicker degrees development dll draganddrop drawing encryption enum event excel file filename files form format forms function gdi+ gis gtk hash httpwebrequest image index input install java label lisp list listbox mandelbrot math mouseclick mysql operator outlook2003 path photoshop picturebox pixelinversion pixelminversion post programming radians regex remoting richtextbox server sleep snooze socket sql statistics stream string table tables text textbox thread time timer update usercontrol usercontrols validation visualstudio webbrowser webcam wia windows winforms wpf xml






