473,325 Members | 2,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Label problem

I have some labels that the text won't update. I have others that do
fine. Is there some properties I need to change or something? I've
deleted the labels and put them back in again and still nothing. This
is driving me nuts.

Jun 5 '06 #1
7 1100
On 5 Jun 2006 15:55:27 -0700, me*****@hotmail.com wrote:
I have some labels that the text won't update. I have others that do
fine. Is there some properties I need to change or something? I've
deleted the labels and put them back in again and still nothing. This
is driving me nuts.


You should really post a piece of code that shows how you are using
the problem labels. As you mention "update", you may just need to
refresh the labels:

Label1.Text = SomeNewText
Label1.Refresh()
Gene
Jun 6 '06 #2
To be honest, I just have something like label9.text = "Some Text".
This works fine normally, I've never had a problem. But this is
differentI had the code in a module that
called mainform.label10.text, but it didn't work. So I moved it to the
mainform code, and changed it to me. label10.text, and nothing, so I
just changed it to label10.text and still nothing even tho I have other
labels that update just fine from the mainform class and form2 class.
The only difference is that I wrote the code for the labels that work
very early in development and now its maybe a 5-6 days later and I
can't get the others to work right. I may end up just starting from
scratch and rebuilding the form on a new project and transfering the
code over.

Jun 7 '06 #3
I forgot to add that the info I put into the label is part of a
response from a webservice. I know it works because I've tested it by
having it print out to a msgbox. If I change the label to something
like label10.text = "Test", it still doesn't do anything. I've tried
putting label10.refresh and nothing as well.

Jun 7 '06 #4
On 7 Jun 2006 15:39:41 -0700, me*****@hotmail.com wrote:
I forgot to add that the info I put into the label is part of a
response from a webservice. I know it works because I've tested it by
having it print out to a msgbox. If I change the label to something
like label10.text = "Test", it still doesn't do anything. I've tried
putting label10.refresh and nothing as well.

Are you saying you have something in a routine like:

MsgBox ("Test")
label10.text = "Test"

and MsgBox result is "Test" and Label10 result is ""?

Have you tried setting a breakpoint at one of these labels and seeing
what the label value is after executing that line of code?

I had a similiar situation once with a textbox. The textbox initially
displayed text as expected. I subsequently expanded the routine and
the text no longer displayed as expected. To make a long story short,
it turned out that the value of the textbox was still initially
correct, but the updated code block had a subsequent "misplaced" line
that was clearing the textbox.

Gene
Jun 7 '06 #5
wow, I think I just figured a little bit of it out. I fiddled with the
code a little and apparently I'm using threading and didn't know it. I
have imports system.threading @ the beginning of the class but figured
I would have to initiate the threading later on for it to take effect.
So I guess I need to go deeper into the forums and look into changing
the label in a thread.

Heres what I'm getting now-------> Cross-thread operation not valid:
Control 'Label10' accessed from a thread other than the thread it was
created on.

The plan was to use threading later on once I had all the code setup.

Jun 7 '06 #6
I had the msgbox setup as the result from the response, not the text.
I put the response array into a datagrid and then called column 1 on
the lookup I needed. Like I said tho, I think I'm getting into some
unintended consequences with the imports system.threading.

Jun 7 '06 #7
On 7 Jun 2006 16:56:06 -0700, me*****@hotmail.com wrote:
wow, I think I just figured a little bit of it out. I fiddled with the
code a little and apparently I'm using threading and didn't know it. I
have imports system.threading @ the beginning of the class but figured
I would have to initiate the threading later on for it to take effect.
So I guess I need to go deeper into the forums and look into changing
the label in a thread.

Heres what I'm getting now-------> Cross-thread operation not valid:
Control 'Label10' accessed from a thread other than the thread it was
created on.

The plan was to use threading later on once I had all the code setup.


Follow the exception helper to How to: Make Thread-Safe Calls to
Windows Forms Controls which has an exapmle using a textbox (which
would be same for a label). A couple of methods are demonstrated, but
best is using the Invoke method.
Gene
Jun 8 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: WindAndWaves | last post by:
Hi Gurus I have a very simple question this time. I have a continuous form with a textbox (ID number) and a label. The label has a on_click event: msgbox me.id.value If I click on the...
1
by: Venki | last post by:
I have a textbox to enter an email address followed by a telephone textbox. The email has a regularexpressionvalidator and a requiredfieldvalidator. The ReqField works fine, but if I put in an...
1
by: sck10 | last post by:
Hello, I am pulling data from a SQL Server table. One field that is (varchar 4000) is used to show notes. I am using a FormView for showing and editing the data. When the form is in Item...
1
by: Kenneth Siewers Møller | last post by:
Hi there I have a custom label control (GradientLabel) which enherits from Label and basically just paints the background of a label in a gradient. In my code I have the following for the...
2
by: André Hänsel | last post by:
Hi again, I have a radio button: <p> <input id="v_yes" type="radio" name="v" value="yes" /> <label for="v_yes">Ja</label> <input id="v_no" type="radio" name="v" value="no" /> <label...
3
by: Ralph | last post by:
Hi I have small function to generate my form controls: function buildInput(sType, vValue, vId, sName, sLabel){ var oInput = null; var oLabel = document.createElement('label'); var oCont =...
1
by: Manoj Mittal | last post by:
I have created the Dynamic control in asp.net c# like for (int i = 1; i <= 5; i++) { Label label = new Label(); label.ID = "Label" + i; label.Text = "Label"+i; form1.Controls.Add(label); }
5
by: BobLaughland | last post by:
Hi There, I am trying to get some fields to align on a web page, like this, To: From: Subject: Each of the fields above have a corresponding asp:Textbox control next to it that I cannot...
1
by: Jim in Arizona | last post by:
On one page I have a datalist where a message is bound to a label. On another page I have the datalist which allows for the insert of new message as well as being able to edit those messages. The...
0
by: Guilherme Polo | last post by:
On Wed, Sep 3, 2008 at 8:57 PM, Kevin McKinley <kem1723@yahoo.comwrote: Come on.. "help on lines 384-403", that is not a good way to look for help. You are supposed to post some minimal code that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.