473,811 Members | 2,971 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1431
Two ways. one and simple way is to use Application.DoE vents() 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*******@addr ess.com> wrote in message
news:uz******** ********@TK2MSF TNGP12.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.EventArg s) Handles MyBase.Activate d
For i As Integer = 1 To 100000000
If i Mod 100 = 0 Then
TextBox1.Show()
End If
TextBox1.Append Text(i.ToString )
Next
End Sub
///

I hope this helps?

Cor
Nov 21 '05 #3
"John Smith" <no*******@addr ess.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.DoE vents() ' See documentation.
///

Solution 2:

Multithreading + Windows Forms:

<URL:http://msdn.microsoft. com/library/en-us/dnforms/html/winforms0611200 2.asp>
<URL:http://msdn.microsoft. com/library/en-us/dnforms/html/winforms0816200 2.asp>
<URL:http://msdn.microsoft. com/library/en-us/dnforms/html/winforms0123200 3.asp>

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

<URL:http://msdn.microsoft. com/library/en-us/cpref/html/frlrfSystemWind owsFormsControl ClassInvokeTopi c.asp>

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

Sample:

FileSystemEnume rator
<URL:http://dotnet.mvps.org/dotnet/samples/filesystem/downloads/FileSystemEnume rator.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******** ******@TK2MSFTN GP11.phx.gbl...
"John Smith" <no*******@addr ess.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.DoE vents() ' See documentation.
///

Solution 2:

Multithreading + Windows Forms:

<URL:http://msdn.microsoft. com/library/en-us/dnforms/html/winforms0611200 2.asp>
<URL:http://msdn.microsoft. com/library/en-us/dnforms/html/winforms0816200 2.asp>
<URL:http://msdn.microsoft. com/library/en-us/dnforms/html/winforms0123200 3.asp>

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

<URL:http://msdn.microsoft. com/library/en-us/cpref/html/frlrfSystemWind owsFormsControl ClassInvokeTopi c.asp>

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

Sample:

FileSystemEnume rator
<URL:http://dotnet.mvps.org/dotnet/samples/filesystem/downloads/FileSystemEnume rator.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******** ******@TK2MSFTN GP11.phx.gbl...
"John Smith" <no*******@addr ess.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.DoE vents() ' See documentation.
///

Solution 2:

Multithreading + Windows Forms:

<URL:http://msdn.microsoft. com/library/en-us/dnforms/html/winforms0611200 2.asp>
<URL:http://msdn.microsoft. com/library/en-us/dnforms/html/winforms0816200 2.asp>
<URL:http://msdn.microsoft. com/library/en-us/dnforms/html/winforms0123200 3.asp>

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

<URL:http://msdn.microsoft. com/library/en-us/cpref/html/frlrfSystemWind owsFormsControl ClassInvokeTopi c.asp>

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

Sample:

FileSystemEnume rator
<URL:http://dotnet.mvps.org/dotnet/samples/filesystem/downloads/FileSystemEnume rator.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
2129
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 2002, .Net Framework 1.0 SP2. I create a new project, and add a new web form to the project. On the page properties, I set EnableViewState to False and verify that the @ Page directive has "enableViewState=false" in it. I then add a TextBox...
2
1879
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 controls). I control the visibility of the panels according to what mode the ascx is in.
2
2917
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 avoid the problem by avoiding the table control or resorting to databound controls that better manage state for me. I hope to understand how to solve the problem by using the Table web control and sticking to the approach of building the table at run...
3
2380
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: "It is a common misconception among developers that view state is somehow responsible for having TextBoxes, CheckBoxes, DropDownLists, and other Web controls remember their values across postback. This is not the case, as the values are...
0
4169
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 "inizialize" the Data Grid View (add a data sorce, filled with notthing at staratup, and hide some columns) when i put a code in the txtCLCOD textbox start a searsh. If i foud something i popolate the Data grid view on the second page. Now the magic if i...
6
2056
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 using TDD as well to improve our ability to refactor... you probably all know this approach. Although the user iterface is supposedly one of the last things that you need to do, this is a web app and we have multiple nested Repeaters on the page....
0
2405
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 View I want the form populated from there profile on the sql server. The code to save the profile works fine. But when the user logs back in they data doesn't load back to the form. The multiview is located inside the LoginView's Logged-In View ....
12
4729
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 variable in the url. I would like that variable to trigger a stored and
0
1401
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 the code which is in my html page plz help........ private void Page_Load(object sender, System.EventArgs e) { if (!Page.IsPostBack) { BindData(); }
0
3124
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 page is loaded, I populate the various form controls with data inside each of the 6 Views by accessing my exposed properties of my User Control. All the controls persist during postback, and any changes I make also persist during postbacks, but...
0
9730
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10392
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...
1
10403
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
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
7671
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
6893
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
5693
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4341
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.