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

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

Jan
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
Nov 20 '05 #1
4 1071
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

Nov 20 '05 #2
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
Nov 20 '05 #3
Hi OHM,

Oops! Where does Form2 get Form1 from?

Regards,
Fergus
Nov 20 '05 #4
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

Nov 20 '05 #5

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

Similar topics

7
by: DazedAndConfused | last post by:
Curently I manualy code keypress edits. i.e. allow only 3 digits before decimal and two digits after decimal in .NET. Is there an easy solution to mask text boxes? The MSMASK32.OCX from vb6...
0
by: George Wei | last post by:
There are 2 pages Default.aspx and Result.aspx: <!-- Default.aspx --> <%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Default.master" CodeFile="Default.aspx.cs"...
5
by: k | last post by:
Hi, I have a problem. To edit the content of a text box in a form I can use the following code: document.getElementById('bugSteps').value = "data" But I can't figure how to do this in a...
1
by: sudip2008 | last post by:
When using the Calendar Popup in a content page of a masterpage the strForName is always set to aspnetForm This breaks this line from working properly window.opener.document.forms...... How can...
0
by: Aneesh Pulukkul [http://dotnet-revolutions.blogspo | last post by:
I have a requirement- need to display RTF content in context menu. I am able to host a rich textbox in a contextmenu strip using ToolStripControlHost class. But assigning some RTF content to the...
1
by: =?Utf-8?B?dmJTdHVkZW50?= | last post by:
Dear All, I have textbox in my form .. I enter the student name in the text e.x (vbstudent) I want to sign textbox data to array, each letter in one index. ex array(0)=v array(1)=b
5
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a VS 2008 ASP.NET webform that has a reportview tag on it, accessing an .RLDC report in local report. The columns for the report are essentially: Month Item #1 Item#2 Item#3 ...
3
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
2
Claus Mygind
by: Claus Mygind | last post by:
I have an array of objects (a hash table). My section of code, the "for in" loop (lines 18 to 41) does not execute at full speed. But if I put in an alert box (line 13) to stop program execution...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
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
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...

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.