473,508 Members | 2,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Textbox text isn't updating

I have a textbox (textBox7) that isn't updating..
Is there a way, after I type new text in it, to have it update?
It seems to be fairly normal:

public class Form1
: System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox7;
......
private void InitializeComponent()
{
this.textBox7 = new System.Windows.Forms.TextBox();

// textBox7
//
this.textBox7.Location = new System.Drawing.Point(248, 32);
this.textBox7.Name = "textBox7";
this.textBox7.Size = new System.Drawing.Size(72, 20);
this.textBox7.TabIndex = 69;
this.textBox7.Text = "";
//
this.Controls.Add(this.textBox7);
Ok, the Form1 is idol and I type "100".

then debug and watch here:
public void getTextBox7()
{
Form1 this2watch = new Form1();
string addwatch = this.textBox7.Text;<<<Nothing is in here!
Class1.watCHTimer1 = Convert.ToInt16(addwatch);
}

thanks in advance,
Trint

Thanks,
Trint

Nov 17 '05 #1
7 2212
you type in the text, and click a button to get into this procedure?
If not, when getTextBox7() being called?
"trint" <tr***********@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
I have a textbox (textBox7) that isn't updating..
Is there a way, after I type new text in it, to have it update?
It seems to be fairly normal:

public class Form1
: System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox7;
.....
private void InitializeComponent()
{
this.textBox7 = new System.Windows.Forms.TextBox();

// textBox7
//
this.textBox7.Location = new System.Drawing.Point(248, 32);
this.textBox7.Name = "textBox7";
this.textBox7.Size = new System.Drawing.Size(72, 20);
this.textBox7.TabIndex = 69;
this.textBox7.Text = "";
//
this.Controls.Add(this.textBox7);
Ok, the Form1 is idol and I type "100".

then debug and watch here:
public void getTextBox7()
{
Form1 this2watch = new Form1();
string addwatch = this.textBox7.Text;<<<Nothing is in here!
Class1.watCHTimer1 = Convert.ToInt16(addwatch);
}

thanks in advance,
Trint

Thanks,
Trint

Nov 17 '05 #2
I just put a value in the textbox and run a function that is supposed to
get the text from the box and assign it to a string. That's it. And
there is nothing in it.
trint

..Net programmer
tr***********@gmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3
Hi,

Who/ Where call getTextBox7() ?

do you mean that even if you type something in you do not see it on the
screen?

Please give more details

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"trint" <tr***********@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
I have a textbox (textBox7) that isn't updating..
Is there a way, after I type new text in it, to have it update?
It seems to be fairly normal:

public class Form1
: System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox7;
.....
private void InitializeComponent()
{
this.textBox7 = new System.Windows.Forms.TextBox();

// textBox7
//
this.textBox7.Location = new System.Drawing.Point(248, 32);
this.textBox7.Name = "textBox7";
this.textBox7.Size = new System.Drawing.Size(72, 20);
this.textBox7.TabIndex = 69;
this.textBox7.Text = "";
//
this.Controls.Add(this.textBox7);
Ok, the Form1 is idol and I type "100".

then debug and watch here:
public void getTextBox7()
{
Form1 this2watch = new Form1();
string addwatch = this.textBox7.Text;<<<Nothing is in here!
Class1.watCHTimer1 = Convert.ToInt16(addwatch);
}

thanks in advance,
Trint

Thanks,
Trint

Nov 17 '05 #4
Ok,
This is where it is called:
From Class1.cs:
public static void testwatcher()
{
Form1 finDWatchInt = new Form1();
do
{
finDWatchInt.getTextBox7(); <<This is the call.
watCHTimer1 = Convert.ToInt16(finDWatchInt.textBox6.Text);
MessageBox.Show("Please enter a number value!");
}
while(watCHTimer1 < 1);
}

Thanks,
Trint

Ignacio Machin ( .NET/ C# MVP ) wrote: Hi,

Who/ Where call getTextBox7() ?

do you mean that even if you type something in you do not see it on the screen?

Please give more details

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"trint" <tr***********@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
I have a textbox (textBox7) that isn't updating..
Is there a way, after I type new text in it, to have it update?
It seems to be fairly normal:

public class Form1
: System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox7;
.....
private void InitializeComponent()
{
this.textBox7 = new System.Windows.Forms.TextBox();

// textBox7
//
this.textBox7.Location = new System.Drawing.Point(248, 32);
this.textBox7.Name = "textBox7";
this.textBox7.Size = new System.Drawing.Size(72, 20);
this.textBox7.TabIndex = 69;
this.textBox7.Text = "";
//
this.Controls.Add(this.textBox7);
Ok, the Form1 is idol and I type "100".

then debug and watch here:
public void getTextBox7()
{
Form1 this2watch = new Form1();
string addwatch = this.textBox7.Text;<<<Nothing is in here!
Class1.watCHTimer1 = Convert.ToInt16(addwatch);
}

thanks in advance,
Trint

Thanks,
Trint


Nov 17 '05 #5
Hi,

There are a number of thing I do not get from your code,

Why testwatcher is static?

You are not even showing the form in the first place, how do you expect it
to have a value?

Form1 finDWatchInt = new Form1();
do
{
finDWatchInt.ShowDialog(); // ********* include this line
finDWatchInt.getTextBox7(); <<This is the call.
watCHTimer1 = Convert.ToInt16(finDWatchInt.textBox6.Text);
MessageBox.Show("Please enter a number value!");
}
while(watCHTimer1 < 1);
}

still I do not understand what you are trying to do.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"trint" <tr***********@gmail.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
Ok,
This is where it is called:
From Class1.cs:


public static void testwatcher()
{
Form1 finDWatchInt = new Form1();
do
{
finDWatchInt.getTextBox7(); <<This is the call.
watCHTimer1 = Convert.ToInt16(finDWatchInt.textBox6.Text);
MessageBox.Show("Please enter a number value!");
}
while(watCHTimer1 < 1);
}

Thanks,
Trint

Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

Who/ Where call getTextBox7() ?

do you mean that even if you type something in you do not see it on

the
screen?

Please give more details

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"trint" <tr***********@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
>I have a textbox (textBox7) that isn't updating..
> Is there a way, after I type new text in it, to have it update?
> It seems to be fairly normal:
>
> public class Form1
> : System.Windows.Forms.Form
> {
> private System.Windows.Forms.TextBox textBox7;
> .....
> private void InitializeComponent()
> {
> this.textBox7 = new System.Windows.Forms.TextBox();
>
> // textBox7
> //
> this.textBox7.Location = new System.Drawing.Point(248, 32);
> this.textBox7.Name = "textBox7";
> this.textBox7.Size = new System.Drawing.Size(72, 20);
> this.textBox7.TabIndex = 69;
> this.textBox7.Text = "";
> //
> this.Controls.Add(this.textBox7);
>
>
> Ok, the Form1 is idol and I type "100".
>
> then debug and watch here:
> public void getTextBox7()
> {
> Form1 this2watch = new Form1();
> string addwatch = this.textBox7.Text;<<<Nothing is in here!
> Class1.watCHTimer1 = Convert.ToInt16(addwatch);
> }
>
> thanks in advance,
> Trint
>
>
>
> Thanks,
> Trint
>

Nov 17 '05 #6
Ignacio,
I can't do a "finDWatchInt.ShowDialog(); because the Form1 is already
showing (Form1 would then appear twice???). This happens as a result
of this button click:

public void button19_Click(object sender, System.EventArgs e)
{
Class1.testwatcher();
}
Thanks,
Trint
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

There are a number of thing I do not get from your code,

Why testwatcher is static?

You are not even showing the form in the first place, how do you expect it to have a value?

Form1 finDWatchInt = new Form1();
do
{
finDWatchInt.ShowDialog(); // ********* include this line
finDWatchInt.getTextBox7(); <<This is the call.
watCHTimer1 = Convert.ToInt16(finDWatchInt.textBox6.Text);
MessageBox.Show("Please enter a number value!");
}
while(watCHTimer1 < 1);
}

still I do not understand what you are trying to do.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"trint" <tr***********@gmail.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
Ok,
This is where it is called:
From Class1.cs:


public static void testwatcher()
{
Form1 finDWatchInt = new Form1();
do
{
finDWatchInt.getTextBox7(); <<This is the call.
watCHTimer1 = Convert.ToInt16(finDWatchInt.textBox6.Text);
MessageBox.Show("Please enter a number value!");
}
while(watCHTimer1 < 1);
}

Thanks,
Trint

Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

Who/ Where call getTextBox7() ?

do you mean that even if you type something in you do not see it
on the
screen?

Please give more details

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"trint" <tr***********@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
>I have a textbox (textBox7) that isn't updating..
> Is there a way, after I type new text in it, to have it update?
> It seems to be fairly normal:
>
> public class Form1
> : System.Windows.Forms.Form
> {
> private System.Windows.Forms.TextBox textBox7;
> .....
> private void InitializeComponent()
> {
> this.textBox7 = new System.Windows.Forms.TextBox();
>
> // textBox7
> //
> this.textBox7.Location = new System.Drawing.Point(248, 32);
> this.textBox7.Name = "textBox7";
> this.textBox7.Size = new System.Drawing.Size(72, 20);
> this.textBox7.TabIndex = 69;
> this.textBox7.Text = "";
> //
> this.Controls.Add(this.textBox7);
>
>
> Ok, the Form1 is idol and I type "100".
>
> then debug and watch here:
> public void getTextBox7()
> {
> Form1 this2watch = new Form1();
> string addwatch = this.textBox7.Text;<<<Nothing is in here!
> Class1.watCHTimer1 = Convert.ToInt16(addwatch);
> }
>
> thanks in advance,
> Trint
>
>
>
> Thanks,
> Trint
>


Nov 17 '05 #7
Hi Trinit,
Just by creating a form it does not show it in the screen, unless you call
Show() on it.

You are creating a new instance of Form1:

public static void testwatcher()
{
Form1 finDWatchInt = new Form1();

so this instance is not being displayed in the screen, unless you call Show
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"trint" <tr***********@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Ignacio,
I can't do a "finDWatchInt.ShowDialog(); because the Form1 is already
showing (Form1 would then appear twice???). This happens as a result
of this button click:

public void button19_Click(object sender, System.EventArgs e)
{
Class1.testwatcher();
}
Thanks,
Trint
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

There are a number of thing I do not get from your code,

Why testwatcher is static?

You are not even showing the form in the first place, how do you

expect it
to have a value?

Form1 finDWatchInt = new Form1();
do
{
finDWatchInt.ShowDialog(); // ********* include this line
finDWatchInt.getTextBox7(); <<This is the call.
watCHTimer1 = Convert.ToInt16(finDWatchInt.textBox6.Text);
MessageBox.Show("Please enter a number value!");
}
while(watCHTimer1 < 1);
}

still I do not understand what you are trying to do.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"trint" <tr***********@gmail.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
> Ok,
> This is where it is called:
>
>>From Class1.cs:
>
> public static void testwatcher()
> {
> Form1 finDWatchInt = new Form1();
> do
> {
> finDWatchInt.getTextBox7(); <<This is the call.
> watCHTimer1 = Convert.ToInt16(finDWatchInt.textBox6.Text);
> MessageBox.Show("Please enter a number value!");
> }
> while(watCHTimer1 < 1);
> }
>
> Thanks,
> Trint
>
> Ignacio Machin ( .NET/ C# MVP ) wrote:
>> Hi,
>>
>> Who/ Where call getTextBox7() ?
>>
>> do you mean that even if you type something in you do not see it on > the
>> screen?
>>
>> Please give more details
>>
>> cheers,
>>
>> --
>> Ignacio Machin,
>> ignacio.machin AT dot.state.fl.us
>> Florida Department Of Transportation
>>
>> "trint" <tr***********@gmail.com> wrote in message
>> news:11*********************@z14g2000cwz.googlegro ups.com...
>> >I have a textbox (textBox7) that isn't updating..
>> > Is there a way, after I type new text in it, to have it update?
>> > It seems to be fairly normal:
>> >
>> > public class Form1
>> > : System.Windows.Forms.Form
>> > {
>> > private System.Windows.Forms.TextBox textBox7;
>> > .....
>> > private void InitializeComponent()
>> > {
>> > this.textBox7 = new System.Windows.Forms.TextBox();
>> >
>> > // textBox7
>> > //
>> > this.textBox7.Location = new System.Drawing.Point(248, 32);
>> > this.textBox7.Name = "textBox7";
>> > this.textBox7.Size = new System.Drawing.Size(72, 20);
>> > this.textBox7.TabIndex = 69;
>> > this.textBox7.Text = "";
>> > //
>> > this.Controls.Add(this.textBox7);
>> >
>> >
>> > Ok, the Form1 is idol and I type "100".
>> >
>> > then debug and watch here:
>> > public void getTextBox7()
>> > {
>> > Form1 this2watch = new Form1();
>> > string addwatch = this.textBox7.Text;<<<Nothing is in here!
>> > Class1.watCHTimer1 = Convert.ToInt16(addwatch);
>> > }
>> >
>> > thanks in advance,
>> > Trint
>> >
>> >
>> >
>> > Thanks,
>> > Trint
>> >
>

Nov 17 '05 #8

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

Similar topics

28
4293
by: kfrost | last post by:
I know this is probably simple but I have a C# form and the class for the form is called sbaSynch. I have a textbox name txtServerName. I'm creating a class to manipulate XML functions so I...
4
6969
by: Grant Schenck | last post by:
I want to append text to the end of a text box. If the cursor is currently at the end I just want to append it and have the normal scrolling take place if needed. However, if the selection...
7
2206
by: Peter D.C. | last post by:
Hi I want to update data hold in several textbox controls on an asp.net form. But it seems like it is the old textbox values that is "re-updates" through a stored procedure who updates a SQL...
1
4283
by: sekisho | last post by:
I'm dynamically adding a column of labels and a column of text boxes to a panel on a webform, based on data returned from an SQL query, which the user builds by selecting options from a few...
22
3088
by: Tim | last post by:
Hi A while ago I got some help in writing a mock console. The idea was to write a VB app that contained a textbox, then run a process from within the app and redirect the stdout to the textbox. ...
3
2207
by: Brad Rogers | last post by:
All, Being immersed in vb.net and trying CSharp after almost a year I forgot the differences. I like vb fixing the uppercase/lowercase names and seeming to be more flexible to code entry. ...
0
1902
by: CCLeasing | last post by:
Hello, I have searched google but can not find a straight forward answer to my problem. Hopefuly someone will be kind enough to offer their expertise. Please forgive if this seems a bit convoluted...
9
11927
by: Phill W. | last post by:
VB.Net 2005 SP1 Windows Forms Application What's the fastest way to append text to a TextBox? I have an application that monitors data written to text files. It needs to scan some fairly...
0
2480
by: Mike | last post by:
So here's the situation (.NET 2.0 btw): I have a form, and on this form is a textbox among many other databound controls. The textbox is bound to a field in a data table via the Text property. ...
0
7223
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
7115
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...
0
7321
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,...
0
7377
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...
1
7036
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...
0
5624
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,...
0
3191
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...
0
1547
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 ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.