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

Populating a form’s textbox with data from a second form.

1
The application has two forms. The main form (Form#1) utilizes threading. One of these threads is used for reading in parameters from a TCP/IP socket. Once the value of one specific parameter has changed, I want to display this new value in a textbox on the second form (Form#2). I have listed what I believe to be the significant parts of the code below.
Form#1:
//Resetting the manually adjusted 'gusBundlesPlacedOnPallet' parameter
if (gusBundlesInRow > 0)
{
gusBundlesInRow = 0;
//Update the 'BundlesOnPallet' display on the 'Manual Page' frmManualMode ManualMode = new frmManualMode(); ManualMode.NoOfBundlesInPalletizerDisplay(Convert. ToString(iIncomingMsg[15]));
}//End-if

Form#2:
//Creating a NoOfBundlesInPalletizer Delegate
public delegate void NoOfBundlesInPalletizerDisplayDelegate(string sMessage);
public void NoOfBundlesInPalletizerDisplay(string sMessage) {
if (txtBundlesInPalletizer.InvokeRequired)
{
Invoke(newNoOfBundlesInPalletizerDisplayDelegate(N oOfBundlesInPalletizerDisplay), new object[] { sMessage });
}//End-if
else
{
this.txtBundlesInPalletizer.Text = sMessage;
}//End else-if
}//End method NoOfBundlesToPalletizeDisplay

The textbox on Form#2 will not show the new value, although if I insert a break point just after I have assign the new value to the textbox (sMessage), it does contain the correct value.
Additionally, if I close the second form and then reopen it, it will show the correct value.

Can anyone tell me what I’m doing wrong?

Thanks in advance

Terje
Jun 18 '10 #1
0 1076

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: intl04 | last post by:
Is it possible to create a Word form as the data entry form for an Access database? I didn't see any reference to this possibility in my Access books, so I'm sorry if this is a question that is...
3
by: Omar Llanos | last post by:
I have Form1 and Form2 (which is inherited from Form1), and I created a button in Form2 that will fill up a textbox in Form1. What code would do that? I tried the simplest way: //from child...
2
by: Lupina | last post by:
I want to read date from contols of first Form (Form1) being in other (eg: DialogOptions). I know how to refer to others froms being in Main, but I can't inversely. Eg: in Form1 I have textBox1...
10
by: Jane Sharpe | last post by:
Hi, I have a textbox with the words "Enter your name here" inserted as default text - At the moment, to remove this the user must highlight all the text and delete before they type in their name...
3
by: DotNetNewbie | last post by:
I am reading the book Teach Yourself Microsoft Visual Basic .Net 2003 in 21 Days. I am having trouble getting one of the exercises to work at the end of day 4. Exercises: 1. Create a new...
17
by: lokidog | last post by:
I am trying to automatically transfer data from one textbox to another between subforms within a 'main' form. I put this code into the Gotfocus eventprocedure: Private Sub Date_GotFocus() If...
11
by: Gilberto | last post by:
Hello I have two forms: Projects and Engineering In PROJECTS i have a textbox (VARIANT1) where the user will enter some text. I want this text to automatically appear as text on another TEXTBOX...
0
pod
by: pod | last post by:
I am new to OOD and n-tier architecture but I want to start the right way. In Visual Studio, I have created a solution with three projects c/w reference to each other i.e. the Business Logic...
1
by: sprad | last post by:
I try to copy value of textbox from one form to another textbox of another form when checkbox is checked. So did anybody have idea how to do it.Please reply me as soon as possible. Thanks..
2
by: cheweedog | last post by:
Can't set the open form by specific data. The form fields don't appear to choose. Trying to link number to number. One form contains a field called number, but does not appear as a choice to <> to...
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.