473,666 Members | 2,302 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 InitializeCompo nent()
{
this.textBox7 = new System.Windows. Forms.TextBox() ;

// textBox7
//
this.textBox7.L ocation = new System.Drawing. Point(248, 32);
this.textBox7.N ame = "textBox7";
this.textBox7.S ize = new System.Drawing. Size(72, 20);
this.textBox7.T abIndex = 69;
this.textBox7.T ext = "";
//
this.Controls.A dd(this.textBox 7);
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.T ext;<<<Nothing is in here!
Class1.watCHTim er1 = Convert.ToInt16 (addwatch);
}

thanks in advance,
Trint

Thanks,
Trint

Nov 17 '05 #1
7 2228
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******** *************@z 14g2000cwz.goog legroups.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 InitializeCompo nent()
{
this.textBox7 = new System.Windows. Forms.TextBox() ;

// textBox7
//
this.textBox7.L ocation = new System.Drawing. Point(248, 32);
this.textBox7.N ame = "textBox7";
this.textBox7.S ize = new System.Drawing. Size(72, 20);
this.textBox7.T abIndex = 69;
this.textBox7.T ext = "";
//
this.Controls.A dd(this.textBox 7);
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.T ext;<<<Nothing is in here!
Class1.watCHTim er1 = 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***********@g mail.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******** *************@z 14g2000cwz.goog legroups.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 InitializeCompo nent()
{
this.textBox7 = new System.Windows. Forms.TextBox() ;

// textBox7
//
this.textBox7.L ocation = new System.Drawing. Point(248, 32);
this.textBox7.N ame = "textBox7";
this.textBox7.S ize = new System.Drawing. Size(72, 20);
this.textBox7.T abIndex = 69;
this.textBox7.T ext = "";
//
this.Controls.A dd(this.textBox 7);
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.T ext;<<<Nothing is in here!
Class1.watCHTim er1 = 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.ge tTextBox7(); <<This is the call.
watCHTimer1 = Convert.ToInt16 (finDWatchInt.t extBox6.Text);
MessageBox.Show ("Please enter a number value!");
}
while(watCHTime r1 < 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******** *************@z 14g2000cwz.goog legroups.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 InitializeCompo nent()
{
this.textBox7 = new System.Windows. Forms.TextBox() ;

// textBox7
//
this.textBox7.L ocation = new System.Drawing. Point(248, 32);
this.textBox7.N ame = "textBox7";
this.textBox7.S ize = new System.Drawing. Size(72, 20);
this.textBox7.T abIndex = 69;
this.textBox7.T ext = "";
//
this.Controls.A dd(this.textBox 7);
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.T ext;<<<Nothing is in here!
Class1.watCHTim er1 = 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.Sh owDialog(); // ********* include this line
finDWatchInt.ge tTextBox7(); <<This is the call.
watCHTimer1 = Convert.ToInt16 (finDWatchInt.t extBox6.Text);
MessageBox.Show ("Please enter a number value!");
}
while(watCHTime r1 < 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******** *************@l 41g2000cwc.goog legroups.com...
Ok,
This is where it is called:
From Class1.cs:


public static void testwatcher()
{
Form1 finDWatchInt = new Form1();
do
{
finDWatchInt.ge tTextBox7(); <<This is the call.
watCHTimer1 = Convert.ToInt16 (finDWatchInt.t extBox6.Text);
MessageBox.Show ("Please enter a number value!");
}
while(watCHTime r1 < 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******** *************@z 14g2000cwz.goog legroups.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 InitializeCompo nent()
> {
> this.textBox7 = new System.Windows. Forms.TextBox() ;
>
> // textBox7
> //
> this.textBox7.L ocation = new System.Drawing. Point(248, 32);
> this.textBox7.N ame = "textBox7";
> this.textBox7.S ize = new System.Drawing. Size(72, 20);
> this.textBox7.T abIndex = 69;
> this.textBox7.T ext = "";
> //
> this.Controls.A dd(this.textBox 7);
>
>
> 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.T ext;<<<Nothing is in here!
> Class1.watCHTim er1 = Convert.ToInt16 (addwatch);
> }
>
> thanks in advance,
> Trint
>
>
>
> Thanks,
> Trint
>

Nov 17 '05 #6
Ignacio,
I can't do a "finDWatchInt.S howDialog(); 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.EventArg s e)
{
Class1.testwatc her();
}
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.Sh owDialog(); // ********* include this line
finDWatchInt.ge tTextBox7(); <<This is the call.
watCHTimer1 = Convert.ToInt16 (finDWatchInt.t extBox6.Text);
MessageBox.Show ("Please enter a number value!");
}
while(watCHTime r1 < 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******** *************@l 41g2000cwc.goog legroups.com...
Ok,
This is where it is called:
From Class1.cs:


public static void testwatcher()
{
Form1 finDWatchInt = new Form1();
do
{
finDWatchInt.ge tTextBox7(); <<This is the call.
watCHTimer1 = Convert.ToInt16 (finDWatchInt.t extBox6.Text);
MessageBox.Show ("Please enter a number value!");
}
while(watCHTime r1 < 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******** *************@z 14g2000cwz.goog legroups.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 InitializeCompo nent()
> {
> this.textBox7 = new System.Windows. Forms.TextBox() ;
>
> // textBox7
> //
> this.textBox7.L ocation = new System.Drawing. Point(248, 32);
> this.textBox7.N ame = "textBox7";
> this.textBox7.S ize = new System.Drawing. Size(72, 20);
> this.textBox7.T abIndex = 69;
> this.textBox7.T ext = "";
> //
> this.Controls.A dd(this.textBox 7);
>
>
> 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.T ext;<<<Nothing is in here!
> Class1.watCHTim er1 = 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******** *************@z 14g2000cwz.goog legroups.com...
Ignacio,
I can't do a "finDWatchInt.S howDialog(); 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.EventArg s e)
{
Class1.testwatc her();
}
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.Sh owDialog(); // ********* include this line
finDWatchInt.ge tTextBox7(); <<This is the call.
watCHTimer1 = Convert.ToInt16 (finDWatchInt.t extBox6.Text);
MessageBox.Show ("Please enter a number value!");
}
while(watCHTime r1 < 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******** *************@l 41g2000cwc.goog legroups.com...
> Ok,
> This is where it is called:
>
>>From Class1.cs:
>
> public static void testwatcher()
> {
> Form1 finDWatchInt = new Form1();
> do
> {
> finDWatchInt.ge tTextBox7(); <<This is the call.
> watCHTimer1 = Convert.ToInt16 (finDWatchInt.t extBox6.Text);
> MessageBox.Show ("Please enter a number value!");
> }
> while(watCHTime r1 < 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******** *************@z 14g2000cwz.goog legroups.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 InitializeCompo nent()
>> > {
>> > this.textBox7 = new System.Windows. Forms.TextBox() ;
>> >
>> > // textBox7
>> > //
>> > this.textBox7.L ocation = new System.Drawing. Point(248, 32);
>> > this.textBox7.N ame = "textBox7";
>> > this.textBox7.S ize = new System.Drawing. Size(72, 20);
>> > this.textBox7.T abIndex = 69;
>> > this.textBox7.T ext = "";
>> > //
>> > this.Controls.A dd(this.textBox 7);
>> >
>> >
>> > 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.T ext;<<<Nothing is in here!
>> > Class1.watCHTim er1 = 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
4313
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 added a class to project and it's named XmlApi(). In the XmlAPI() class I have simple code as following XmlAPI() { string str = "Some Text";
4
6973
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 isn't at the end of the text box I want to append the text but WITHOUT changing the selection or scrolling the text. I can easily tell if the selection is at the end or not. However, I haven't found away to prevent the scrolling when I AppendText.
7
2215
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 tabel. I know the SP works, because a smalldatetime-field in the database is changed. I've tried to disable viewstate on all textbox controls. Any ideas to solve this problem.
1
4311
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 dropdowns and hitting the 'Search' button. The first column returned is a user name and is added to the panel as a label, the second is a number and is added to the label as the text property of a textbox, so the user can update it. When the...
22
3113
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. My problem was that textboxes have maximum length limits, so I had to write a function to erase some of the text when it started getting full. That appears to work, but I am experiencing odd behaviour when the textbox text gets long. When it got to...
3
2215
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. But while trying to insert a text box to see when a method is used, and putting a counter to bump some variable? The textbox sits there unchanged. I put a breakpoint at the text write
0
1913
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 but this is probabally a reflection of my not clear understanding of the mechanics behind what i'm trying to achieve. Please bear with it I really could do with your help. I have a simple windows form. There are two controls on the form that I...
9
11940
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 hefty files (typically ~15MB) and scanning the file pulling out the rows I want (typically ~10,000 of them) takes /comfortably/ under three seconds. In normal usage, this application will "follow" the end of these files as they are written to, so it...
0
2490
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. In this table there are multiple columns that cannot be NULL, which, are bound to other controls (but they're not really important at this time). I create a new row via the currency manager like so: _currencyManager.AddNew() _currentRow =...
0
8356
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
8781
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
8639
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...
1
6192
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
5663
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
4198
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...
0
4366
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
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
2
1772
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.