PC Review


Reply
Thread Tools Rate Thread

how can I get the content of a textbox into a public array

 
 
Jan
Guest
Posts: n/a
 
      19th Oct 2003
I tried to do it on the following way:

public tempArray() as string = textbox1.lines

this works fine in the actuell form2, but I want to ship the content to
form1. So i declared tempArray in a module but I get a error message on
textbox1.lines. I have to declare it, but it is a textbox in form2.

Is there anyone outhere who can help me out??

Thank you very much
 
Reply With Quote
 
 
 
 
One Handed Man
Guest
Posts: n/a
 
      19th Oct 2003
Yes, declare the array in form one and reference it from form2

form1.tempArray = textbox1.lines

Cheers OHM

Jan wrote:
> I tried to do it on the following way:
>
> public tempArray() as string = textbox1.lines
>
> this works fine in the actuell form2, but I want to ship the content
> to form1. So i declared tempArray in a module but I get a error
> message on textbox1.lines. I have to declare it, but it is a textbox
> in form2.
>
> Is there anyone outhere who can help me out??
>
> Thank you very much



 
Reply With Quote
 
 
 
 
Fergus Cooney
Guest
Posts: n/a
 
      20th Oct 2003
Hi Jan,

On the assumption that you will only have one Form2, a quick fix is to
declare tempArray as Shared. That way you can access it from Form1 very
simply.

In Form2
Public Shared txtboxLines(0) As String 'it's hardly temp!!

Sub SomethingOrOther
txtboxLines = TextBox1.Lines

In Form1
Sub AndAnother
Dim S As String
For Each S In Form2.txtboxLines
Console.WriteLine (S)

Regards,
Fergus


 
Reply With Quote
 
Fergus Cooney
Guest
Posts: n/a
 
      20th Oct 2003
Hi OHM,

Oops! Where does Form2 get Form1 from?

Regards,
Fergus


 
Reply With Quote
 
One Handed Man
Guest
Posts: n/a
 
      20th Oct 2003
Actually, I was ( Assuming that form1 was the parent ) and implying the
parent. me.parent. etc

Post holiday blues

Cheers OHM


Fergus Cooney wrote:
> Hi OHM,
>
> Oops! Where does Form2 get Form1 from?
>
> Regards,
> Fergus



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TextBox to Array, Array Displayed in Textbox Derrick Candler Microsoft VB .NET 0 25th Sep 2011 09:08 AM
Why can I get the index of the item of the array when I use string*, but can not get the index of the array when I use any other type (such as Int32)? Allen Maki Microsoft VC .NET 1 20th Mar 2006 11:44 AM
microsoft.public.developer.outlook.addins, microsoft.public.outlook.program_addins,microsoft.public.dotnet.languages.csharp,microsoft.public.outlook.general Anushya Microsoft C# .NET 0 15th Jan 2004 07:18 AM
microsoft.public.developer.outlook.addins,microsoft.public.dotnet.languages.csharp,microsoft.public.outlook.program_addins,microsoft.public.outlook.general Anushya Microsoft Dot NET Framework Forms 0 9th Jan 2004 08:21 AM
microsoft.public.dotnet.languages.vb.data,microsoft.public.dotnet.languages.vb.controls,microsoft.public .dotnet.languages.vb,microsoft.public.dotnet.languages.vb.upgrade Gladys Microsoft VB .NET 3 2nd Jan 2004 07:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:44 AM.