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

different forms

Hi, I am writting a C# application, not webform
My application has baseform and 4 other forms,
my problem is how to pass the value or data of the textbox from 1st form to
the label or listbox on the last form
all of the forms are inherted from the base form.
I know I can create a global variable but I have a lot of data to pass,

and another question, when I switch to different form, and I use
this.visible= flase
how do I write the code so the main page. visible will become true?
Nov 16 '05 #1
1 1441
Hi there,

there is more than one way to do what you want -

1. You can declare a static variable of the main form's type at the main
form. So when it initializes, you can set the static variable to the
instance that's being created.
From there on, you can access the instance from the other forms.

2. You can pass a reference of the form that opens the second/third/etc form
while opening it. Then access the data that's being contained in it.

3. If you pass variables that are being passed by reference (that means
pretty much everything that is a class type of variable (without strings -
they are being copied always, exept when you pass them by ref), you don't
need to worrie about the amount of the data - you're passing just a
reference - that means that you'll copy only 4 bytes (for the address space
that's gonna be allocated on the stack).
If you want to pass vars that are not of a ref type, then use the ref
keyword for the parameter at function's argument list.

Cheers,
Branimir
--
Branimir Giurov
MCSD.NET, MCDBA, MCT
eAgility LLC

"Michael" <vo*****@hotmail.com> wrote in message
news:9jJhc.1106$0u6.400672@attbi_s03...
Hi, I am writting a C# application, not webform
My application has baseform and 4 other forms,
my problem is how to pass the value or data of the textbox from 1st form to the label or listbox on the last form
all of the forms are inherted from the base form.
I know I can create a global variable but I have a lot of data to pass,

and another question, when I switch to different form, and I use
this.visible= flase
how do I write the code so the main page. visible will become true?

Nov 16 '05 #2

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

Similar topics

1
by: Bryan | last post by:
I have this function below function checkLength(field, nextField) { var letters = document.form1.elements.value.length +1; if (letters <= 2) {document.form1.elements.focus()} else...
4
by: Mike MacSween | last post by:
Yes, I've downloaded and read the white paper (though some time ago). I was considering an alternative to the built-in Access security. Having more than one FE file. For instance there are a few...
2
by: Wayne Aprato | last post by:
How do most Access developers handle the issue of different database users possibly running different screen resolutions? At the moment, I design for the worst case scenario ie. 800 x 600 screen...
7
by: Paolo | last post by:
I know I should not be doing this, but I find it very useful. I have a database in Access which stores data for a small company. Sometimes we need to add similar information to different tables....
5
by: Axel | last post by:
An Access 2000 question Hi is is possible to have (as a subform) a continous form with 0..n buttons which have different images in each row. (Personally I would have preferred a button...
2
by: xnn | last post by:
Hi, I would like to know why an object Label cannot be used on 2 different object Forms at the same time? It has the impct of run-time error. Thank you very much. regards
7
by: gthompson | last post by:
Is this possible: Read fields(rows/columns) from one sql database table (TableA). Then edit/update the same 'field' in TableA; and in TableB edit/update a different field - all at the same time?...
4
by: SB | last post by:
Hi I'm trying to get forms-based authentication to authenticate different users for differet pages, like this: <configuration> <location path="Member" allowOverride="true"> <system.web>...
9
by: Gidi | last post by:
I've created a program in C#, which includes several Forms. some of the forms are in different size, but i start all of them in Window Normal Size. I took the exe file from the \bin\debug library...
3
by: Nerrad | last post by:
hi guys, i have a project on my hand and what i'm told to do is to create a log-in feature using tables and forms. Da question is that is there any way to allow different users different access...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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...
0
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
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...
0
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,...

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.