Building/referencing textbox array

  • Thread starter Thread starter Ken
  • Start date Start date
K

Ken

Hello Everyone,

I am interested in creating a textbox array "AND" be able
to reference the textbox array in my code. Right now , I
am able to build textbox's , but I cannot refer to them in
my code . I think this is because they have not been built
till I hit a button. So, I have been told that maybe I
need to build a textbox array. I would appreciate a simple
example building a textbox array. And how to reference
each of them.
Here is what I have right now:

for(i = 0; i<= mytextboxcount - 1; i++)
{
holdtextbox1 = "";
holdtextbox1 = "txt" + + holdreportinfo[i,0];
TextBox mytextbox = new TextBox();
mylocy = mylocy + myspacing;
mytextbox.Text = "blah blah1";
mytextbox.Name = holdtextbox1;
mytextbox.Location = new System.Drawing.Point(mylocx,
mylocy );
mytextbox.Size = new System.Drawing.Size(mywidth,myheight);
mytextbox.Visible = true;
this.panel1.Controls.Add(mytextbox);
}

Thank You in Advance for your Help,
Ken
 
Hello Herfried K. Wagner,

Thank You for that link, however I need something that
will actually work, not something written on a napkin
during "Happy Hour".

Thank You for Your Help,
Ken
 
I was just about to post you a working example but seeing your attitude you
can write your own.

Hello Herfried K. Wagner,

Thank You for that link, however I need something that
will actually work, not something written on a napkin
during "Happy Hour".

Thank You for Your Help,
Ken
 
Hello,

Stephany Young said:
I was just about to post you a working example but seeing
your attitude you can write your own.

I know it's OT, but... LOL.

SCNR
 
Hello Ken,
If you only want to reference your textbox in the controls, maybe the
Control Array is not required. Just create an TextBox typed Array and then
create the TextBox object dynamically and add it to both controls and your
textbox Array. Then you may reference your textBox by the textbox array.
However, I don't think creating such an array will solve your real
problem(reference? sorry, I'm not clear about what you exactly mean),
please make clear your real problem to us. Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Ken" <[email protected]>
| Sender: "Ken" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Building/referencing textbox array
| Date: Fri, 12 Sep 2003 12:31:41 -0700
| Lines: 29
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: quoted-printable
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcN5ZH3x/MnxQCfzTGqSR8v4CjCztw==
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:52261
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| Hello Herfried K. Wagner,
| Thank You for that link, however I need something that
| will actually work, not something written on a napkin
| during "Happy Hour".
| Thank You for Your Help,
| Ken
| >-----Original Message-----
| >Hello,
| >
| >> I would appreciate a simple example building a
| >> textbox array.
| >
| >Creating Control Arrays in Visual Basic .NET and Visual
| C# .NET
| >http://msdn.microsoft.com/library/?url=/library/en-
| us/dv_vstechart/html/vbtchCreatingControlArraysInVisualBasi
| cNETVisualCNET.asp
| >
| >--
| >Herfried K. Wagner
| >MVP · VB Classic, VB.NET
| >http://www.mvps.org/dotnet
| >
| >
| >.
| >
|
 
Hi Ken,
Sorry for bring you inconvenient when reading our Technical Articles.
Please send your feedback to that article to
"Visual Studio Documentation Feedback" <[email protected]>
with title
_801738 Creating Control Arrays in Visual Basic .NET and Visual C# .NET.
We will try our best to improve our products and docuementations, to make
our customer satisfied.
Thanks!


Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Ken" <[email protected]>
| Sender: "Ken" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Building/referencing textbox array
| Date: Fri, 12 Sep 2003 12:31:41 -0700
| Lines: 29
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: quoted-printable
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcN5ZH3x/MnxQCfzTGqSR8v4CjCztw==
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:52261
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| Hello Herfried K. Wagner,
| Thank You for that link, however I need something that
| will actually work, not something written on a napkin
| during "Happy Hour".
| Thank You for Your Help,
| Ken
| >-----Original Message-----
| >Hello,
| >
| >> I would appreciate a simple example building a
| >> textbox array.
| >
| >Creating Control Arrays in Visual Basic .NET and Visual
| C# .NET
| >http://msdn.microsoft.com/library/?url=/library/en-
| us/dv_vstechart/html/vbtchCreatingControlArraysInVisualBasi
| cNETVisualCNET.asp
| >
| >--
| >Herfried K. Wagner
| >MVP · VB Classic, VB.NET
| >http://www.mvps.org/dotnet
| >
| >
| >.
| >
|
 
Thank You for not caring
-----Original Message-----
I was just about to post you a working example but seeing your attitude you
can write your own.

Hello Herfried K. Wagner,

Thank You for that link, however I need something that
will actually work, not something written on a napkin
during "Happy Hour".

Thank You for Your Help,
Ken
i


.
 
Hi Ken,
How about your problem now? Did my reply answer your question?
If you still have problems on this issue, please let me know!
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" shouldbe removed before
sending, Thanks!

--------------------
| Content-Class: urn:content-classes:message
| From: "ken" <[email protected]>
| Sender: "ken" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Building/referencing textbox array
| Date: Mon, 15 Sep 2003 10:30:41 -0700
| Lines: 43
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: quoted-printable
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcN7rxXXuNgbRhx0SKm0lJSow338iw==
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| Path: cpmsftngxa07.phx.gbl
| Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.windowsforms:52251
| NNTP-Posting-Host: tk2msftngxa12.phx.gbl 10.40.1.164
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| Thank You for not caring
| >-----Original Message-----
| >I was just about to post you a working example but seeing
| your attitude you
| >can write your own.
| >
| >| >Hello Herfried K. Wagner,
| >
| >Thank You for that link, however I need something that
| >will actually work, not something written on a napkin
| >during "Happy Hour".
| >
| >Thank You for Your Help,
| >Ken
| >>-----Original Message-----
| >>Hello,
| >>
| >>> I would appreciate a simple example building a
| >>> textbox array.
| >>
| >>Creating Control Arrays in Visual Basic .NET and Visual
| >C# .NET
| >>http://msdn.microsoft.com/library/?url=/library/en-
| >us/dv_vstechart/html/vbtchCreatingControlArraysInVisualBas
| i
| >cNETVisualCNET.asp
| >>
| >>--
| >>Herfried K. Wagner
| >>MVP · VB Classic, VB.NET
| >>http://www.mvps.org/dotnet
| >>
| >>
| >>.
| >>
| >
| >
| >.
| >
|
 
Back
Top