473,689 Members | 2,920 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Label.text not set right when called, waits for next procedure to finish.

In a VB .NET app I changed the text of a label then proceed to run a stored
procedure which takes about 20 seconds. The label change doesn't show until
after the stored procedure is finished. Is there a way to flush the
label.text change right before the stored procedure call so that the text
will be displayed to the user while the procedure is running?
the "pseudo"cod e for what i have is:

Label5.Visible = True
Label5.Text = "Running procedure..."
cn.Open()
rdr = RunProcedure(cn )
cn.Close()
' comment: This is the point at which Label5 shows up on the application and
says "Running procedure..."

Thanks for any help.
-Nate
Nov 21 '05 #1
4 5071
one - you could try adding Application.DoE vents( ) immediately after
Label5.Text = "Running Procedure..."
two - you could try Label5.Update( ) immediately after Label5.Text =
"Running Procedure..."

hope that helps..
Imran.

"nate axtell" <naxtell at progeny dot net> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
In a VB .NET app I changed the text of a label then proceed to run a stored procedure which takes about 20 seconds. The label change doesn't show until after the stored procedure is finished. Is there a way to flush the
label.text change right before the stored procedure call so that the text
will be displayed to the user while the procedure is running?
the "pseudo"cod e for what i have is:

Label5.Visible = True
Label5.Text = "Running procedure..."
cn.Open()
rdr = RunProcedure(cn )
cn.Close()
' comment: This is the point at which Label5 shows up on the application and says "Running procedure..."

Thanks for any help.
-Nate

Nov 21 '05 #2
* "nate axtell" <naxtell at progeny dot net> scripsit:
In a VB .NET app I changed the text of a label then proceed to run a stored
procedure which takes about 20 seconds. The label change doesn't show until
after the stored procedure is finished. Is there a way to flush the
label.text change right before the stored procedure call so that the text
will be displayed to the user while the procedure is running?
the "pseudo"cod e for what i have is:


Try calling the label's 'Refresh' method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3
Nate,

me.refresh does your job. (When you are still in the load even me.show,
although it can be than an incomplete form)

Mostly this is not nice your application freezes, however maybe that is just
what you want.

(There are more solutions to overcome that, by instance a thread or a timer
with doevents)

Cor
Nov 21 '05 #4
Wow, 4 solutions, and there are probably more. :)
Label5.Update() , Label5.refresh( ), Application.DoE vents(), and me.refresh()
all worked for me.
Thanks for all your help.
Nov 21 '05 #5

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

Similar topics

0
1784
by: Giovane Calabrese | last post by:
ok. im try to make a multilanguage system based on that tutorial : http://www.123aspx.com/redir.aspx?res=29112 in my aspx pages all text are in labels , and i want to take the name labels ( in one loop ) and for each label take on the XML document the right(in the right language) Value (text).
2
1526
by: xzzy | last post by:
I need to update the .Text of a label until the user logs out. but get this error: Error: Method name expected I have listed the code below and the offending line of code is delimited by //The next line breaks: Error: Method name expected
6
3143
by: jcrouse | last post by:
I am rotating some text is some label controls. In the one place I use it it works fine. In the other place I use it I can't figure out the syntax. I don't really understand the event. Where it works fine, it seems to fire when the form changes visibility. Here is the code. Private Sub lblP1JoyUp_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles lblP1JoyUp.Paint If lblP1JoyUp.Visible = True Then Dim...
2
1419
by: rigamonk | last post by:
I have a form that runs a procedure when a button is clicked. the procedure does a few things, then outputs the results to labels on a form....which it does fine. However, when I call that procedure again (in the same instance of the program), the labels do not update. i have tried resetting the text. update(), refresh(), beginUpdate() and endUpdate(), Invalidate() and a few others that sounded pretty good ;-) no dice. any ideas?
5
2330
by: Rich | last post by:
The following code snipet won't run if I initialize my global label array outside of a procedure - say Form_Load. If I initialize the array inside Form_Load then it works. Is there a way to initialize the label array outside of a procedure as I am doing? Or... (see below this snipet) --------------------------------------------------------------------------------- Public Class Form1 Inherits System.Windows.Forms.Form " Windows Form...
0
1176
by: Hawk | last post by:
Hello, this is my first post hope to get some good answers. I am using asp.net 2.0 and I am trying to pass the value entered in the formview textbox in insert mode "in this case it is the default mode" to a label or hidden field outside of the formview when the insert button is pushed. Is there a way to do this? The App I am creating using many interrelated tables by forgiegn keys and in this case I need to insert a record in one...
12
13214
by: vbnewbie | last post by:
I am having problems accessing properties of dynamically generated objects in VB2005. Can someone please help? In a nutshell: My app creates an equal number of checkboxes and labels that share the same Tag number. (I thought it might help) The checkboxes name is a concatenation of "chkCancel" and a number that represents the order in which they were created: chkCancel0 (Tag = 0) chkCancel1 (Tag = 1)
7
1956
by: David | last post by:
i think i just realized i'm an idiot. again. (not syntactically correct code... just pieces to illustrate) class StateObject { members like socket, receiveBuffer, receiveBufferSize, StringBuilder etc.. }
9
8010
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I have a MDI Container Form, with one label control on the Background of this container form. When I now open a child form, this form is behind the label ... and this looks ugly ... :-)) When I set the label with "SendToBack", it completely disapears. I also tried to set the child form like "BringToFront" but this also does not help.
0
8528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9076
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7621
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6454
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5810
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4321
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2219
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1952
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.