473,386 Members | 1,712 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,386 software developers and data experts.

View Data in Textbox

I have a form doing a large process. While this form is doing its
processing I want to write a status to a Textbox of where it is at in the
process. Similar to having a log file but within a textbox. As it reaches
its mark it adds a line to the textbox "Step 2 is complete." or "Step 3
Failed because of...". My problem is that the text within the textbox does
not display until after all of the processing is complete. How can I get
the text to display when it reaches each specific process? Thanx in advance
Nov 21 '05 #1
6 1405
Two ways. one and simple way is to use Application.DoEvents() after you
update the text box but a lot of people say to avoid using that function.
The more complicated way is to use threading to do the processing in a
seperate thread from the UI.

Chris
"John Smith" <no*******@address.com> wrote in message
news:uz****************@TK2MSFTNGP12.phx.gbl...
I have a form doing a large process. While this form is doing its
processing I want to write a status to a Textbox of where it is at in the
process. Similar to having a log file but within a textbox. As it
reaches
its mark it adds a line to the textbox "Step 2 is complete." or "Step 3
Failed because of...". My problem is that the text within the textbox
does
not display until after all of the processing is complete. How can I get
the text to display when it reaches each specific process? Thanx in
advance

Nov 21 '05 #2
John,

You mean something as this
\\\
Private Sub Form1_Activated(ByVal sender _
As Object, ByVal e As System.EventArgs) Handles MyBase.Activated
For i As Integer = 1 To 100000000
If i Mod 100 = 0 Then
TextBox1.Show()
End If
TextBox1.AppendText(i.ToString)
Next
End Sub
///

I hope this helps?

Cor
Nov 21 '05 #3
"John Smith" <no*******@address.com> schrieb:
I have a form doing a large process. While this form is doing its
processing I want to write a status to a Textbox of where it is at in the
process. Similar to having a log file but within a textbox. As it
reaches
its mark it adds a line to the textbox "Step 2 is complete." or "Step 3
Failed because of...". My problem is that the text within the textbox
does
not display until after all of the processing is complete. How can I get
the text to display when it reaches each specific process?


Solution 1:

\\\
With Me.Label1
.Text = ...
.Refresh()
End With
Application.DoEvents() ' See documentation.
///

Solution 2:

Multithreading + Windows Forms:

<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms06112002.asp>
<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms08162002.asp>
<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms01232003.asp>

<URL:http://www.devx.com/dotnet/Article/11358/>

<URL:http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWindowsFormsControlClassInvokeTopic.asp >

Multithreading in Visual Basic .NET (Visual Basic Language Concepts)
<URL:http://msdn.microsoft.com/library/en-us/vbcn7/html/vaconthreadinginvisualbasic.asp>

Sample:

FileSystemEnumerator
<URL:http://dotnet.mvps.org/dotnet/samples/filesystem/downloads/FileSystemEnumerator.zip>

--
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 #4
Herfried, maybe your example here can get you to answer a question I've
wondered about for a while.

With Me.Label1
.Text = ...
.Refresh()
End With

The idea behind the With clause is it allows for faster execution since the
"Me" ojbect doesn't have to be resolved 2 times in your example. But you
could rewrite your sample w/o the Me

With Label1
.Text = ...
.Refresh()
End With

In this case there wouldn't be any inhancement since you are not actually
eliminating the dot. Am I correct in my thinking?

Chris
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ek**************@TK2MSFTNGP11.phx.gbl...
"John Smith" <no*******@address.com> schrieb:
I have a form doing a large process. While this form is doing its
processing I want to write a status to a Textbox of where it is at in the
process. Similar to having a log file but within a textbox. As it
reaches
its mark it adds a line to the textbox "Step 2 is complete." or "Step 3
Failed because of...". My problem is that the text within the textbox
does
not display until after all of the processing is complete. How can I get
the text to display when it reaches each specific process?


Solution 1:

\\\
With Me.Label1
.Text = ...
.Refresh()
End With
Application.DoEvents() ' See documentation.
///

Solution 2:

Multithreading + Windows Forms:

<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms06112002.asp>
<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms08162002.asp>
<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms01232003.asp>

<URL:http://www.devx.com/dotnet/Article/11358/>

<URL:http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWindowsFormsControlClassInvokeTopic.asp >

Multithreading in Visual Basic .NET (Visual Basic Language Concepts)
<URL:http://msdn.microsoft.com/library/en-us/vbcn7/html/vaconthreadinginvisualbasic.asp>

Sample:

FileSystemEnumerator
<URL:http://dotnet.mvps.org/dotnet/samples/filesystem/downloads/FileSystemEnumerator.zip>

--
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 #5
Chris,

"Chris, Master of All Things Insignificant" <chris@No_Spam_Please.com>
schrieb:
Herfried, maybe your example here can get you to answer a question I've
wondered about for a while.

With Me.Label1
.Text = ...
.Refresh()
End With

The idea behind the With clause is it allows for faster execution since
the "Me" ojbect doesn't have to be resolved 2 times in your example. But
you could rewrite your sample w/o the Me

With Label1
.Text = ...
.Refresh()
End With

In this case there wouldn't be any inhancement since you are not actually
eliminating the dot. Am I correct in my thinking?


The 'Me.' is resolved even if it's not explicitly written. In this case I
used With type the code faster ;-).

--
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 #6
Chis,

Not true,

The "Me" is only for the programmer, it does nothing at runtime.

The With clause creates an extra reference in a program. In this case it
will be slower than a program without a With clause, however think than
probably in parts of nanoseconds.

I hope this gives some ideas?

Cor
"Chris, Master of All Things Insignificant"
..
Herfried, maybe your example here can get you to answer a question I've
wondered about for a while.

With Me.Label1
.Text = ...
.Refresh()
End With

The idea behind the With clause is it allows for faster execution since
the "Me" ojbect doesn't have to be resolved 2 times in your example. But
you could rewrite your sample w/o the Me

With Label1
.Text = ...
.Refresh()
End With

In this case there wouldn't be any inhancement since you are not actually
eliminating the dot. Am I correct in my thinking?

Chris
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ek**************@TK2MSFTNGP11.phx.gbl...
"John Smith" <no*******@address.com> schrieb:
I have a form doing a large process. While this form is doing its
processing I want to write a status to a Textbox of where it is at in
the
process. Similar to having a log file but within a textbox. As it
reaches
its mark it adds a line to the textbox "Step 2 is complete." or "Step 3
Failed because of...". My problem is that the text within the textbox
does
not display until after all of the processing is complete. How can I
get
the text to display when it reaches each specific process?


Solution 1:

\\\
With Me.Label1
.Text = ...
.Refresh()
End With
Application.DoEvents() ' See documentation.
///

Solution 2:

Multithreading + Windows Forms:

<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms06112002.asp>
<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms08162002.asp>
<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms01232003.asp>

<URL:http://www.devx.com/dotnet/Article/11358/>

<URL:http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWindowsFormsControlClassInvokeTopic.asp >

Multithreading in Visual Basic .NET (Visual Basic Language Concepts)
<URL:http://msdn.microsoft.com/library/en-us/vbcn7/html/vaconthreadinginvisualbasic.asp>

Sample:

FileSystemEnumerator
<URL:http://dotnet.mvps.org/dotnet/samples/filesystem/downloads/FileSystemEnumerator.zip>

--
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 #7

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

Similar topics

3
by: Philip Tripp | last post by:
I've read numerous sources stating that view state can be disabled per control, and per page, but can't seem to keep web form controls from remembering their state on a postback. I'm using VS.Net...
2
by: Martin | last post by:
Hi, I want to create a number of ascx controls with edit and view modes. Previously I have put two panels in the ascx - one for view (with label subcontrols), and one for edit (with text box...
2
by: Chad | last post by:
I have a problem that I am desperate to understand. It involves dynamically adding controls to a Table control that is built as a result of performing a database query. I am not looking to...
3
by: Neven Klofutar | last post by:
Hi, I recently read an article on MSDN about viewstate and postback. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/viewstate.asp The author states the following:...
0
by: Gian Paolo | last post by:
this is something really i can't find a reason. I have a form with a tabcontrol with tree pages, in the second page there is a Data GRid View. Plus i have a class. When i open the form i...
6
by: Bill44077 | last post by:
Hi, I am new to the MVP pattern and one of the main reasons that we are going this route is because we are doing Scrum with 30 day sprints - so we have a continually morphing design. We are...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
12
by: brwalias | last post by:
Hi, using .net 2 sql server 2005 Here is my situation: I'm passing a variable in the url from a selection on Page A and need to display the results on the Results page be based on that...
0
by: geeteshss | last post by:
the present problem is that i am unable to display data in datagrid....... but the data is visible in database..below is the code what should i do...earlier i could view it also below this code is...
0
by: wfsmith | last post by:
I have a page with a MultiView control and 6 Views. Each view has a User control that contains various form controls (dropdowns, textboxes and CascadingDropDown Ajax.Net controls). When the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.