473,785 Members | 2,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pass locatioin to Secondary Form

Appreciate some direction as to what most of you professionals do when
passing some limited variables to another form. A simple example
would be passing the location of a second form. I could use a
constructor which I think of as parameters attached to the creation of
my New form (parameters) or I could use "properties " as I have learned
to use with classes. Some advice please.

Ed
Jun 27 '08 #1
4 1149
On Thu, 12 Jun 2008 17:11:36 -0400, "Ed Bitzer" <ed******@yahoo .com>
wrote:
>Appreciate some direction as to what most of you professionals do when
passing some limited variables to another form. A simple example
would be passing the location of a second form. I could use a
constructor which I think of as parameters attached to the creation of
my New form (parameters) or I could use "properties " as I have learned
to use with classes. Some advice please.
My personal preference is to use properties in the secondary form to
pass data to it from the calling form.
Jun 27 '08 #2
Thanks Joe... this lets me concentrate on me using added classes to
avoid my historical use of globals and modules and maybe learn to use
them more often.
Ed

"Joe Cool" <jo*****@home.n etwrote in message
news:t1******** *************** *********@4ax.c om...
On Thu, 12 Jun 2008 17:11:36 -0400, "Ed Bitzer" <ed******@yahoo .com>
wrote:
>>Appreciate some direction as to what most of you professionals do
when
passing some limited variables to another form. A simple example
would be passing the location of a second form. I could use a
constructor which I think of as parameters attached to the creation
of
my New form (parameters) or I could use "properties " as I have
learned
to use with classes. Some advice please.

My personal preference is to use properties in the secondary form to
pass data to it from the calling form.

Jun 27 '08 #3
On Fri, 13 Jun 2008 07:03:03 -0400, "Ed Bitzer" <ed******@yahoo .com>
wrote:
>Thanks Joe... this lets me concentrate on me using added classes to
avoid my historical use of globals and modules and maybe learn to use
them more often.
If you ever expect to move to C#.NET, you will be forced to give up on
global variables.
>
"Joe Cool" <jo*****@home.n etwrote in message
news:t1******* *************** **********@4ax. com...
>On Thu, 12 Jun 2008 17:11:36 -0400, "Ed Bitzer" <ed******@yahoo .com>
wrote:
>>>Appreciate some direction as to what most of you professionals do
when
passing some limited variables to another form. A simple example
would be passing the location of a second form. I could use a
constructo r which I think of as parameters attached to the creation
of
my New form (parameters) or I could use "properties " as I have
learned
to use with classes. Some advice please.

My personal preference is to use properties in the secondary form to
pass data to it from the calling form.
Jun 27 '08 #4
Joe,

Rereading my comment to you I see some lack of clarity - I did mean
that I am going to avoid the globals and already have recoded a couple
of older programs I wrote for myself using "properties " (fields) in a
class and dumped the module.

Thanks again, Ed

"Joe Cool" <jo*****@home.n etwrote in message
news:4s******** *************** *********@4ax.c om...
On Fri, 13 Jun 2008 07:03:03 -0400, "Ed Bitzer" <ed******@yahoo .com>
wrote:
>>Thanks Joe... this lets me concentrate on me using added classes to
avoid my historical use of globals and modules and maybe learn to
use
them more often.

If you ever expect to move to C#.NET, you will be forced to give up
on
global variables.
>>
"Joe Cool" <jo*****@home.n etwrote in message
news:t1****** *************** ***********@4ax .com...
>>On Thu, 12 Jun 2008 17:11:36 -0400, "Ed Bitzer"
<ed******@yah oo.com>
wrote:

Appreciat e some direction as to what most of you professionals do
when
passing some limited variables to another form. A simple example
would be passing the location of a second form. I could use a
construct or which I think of as parameters attached to the
creation
of
my New form (parameters) or I could use "properties " as I have
learned
to use with classes. Some advice please.

My personal preference is to use properties in the secondary form
to
pass data to it from the calling form.

Jun 27 '08 #5

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

Similar topics

4
2063
by: R.G. Vervoort | last post by:
Does anyone have a suggestion how I can order a list with names in a secondary select string. The first string selects a number of locations where people work From this string I get several id's form people (in the location table there
7
2837
by: hank | last post by:
Hi All In the Circular Logging when the Primary Log file fill up, the database manager will creat a secondary log files for the transaction; when this transaction finished, the secondary log files still allocated in log directory; when all application disconnect from database or database reactive or database restart the secondary log files will be deleted from log directory. For each transaction log request, database manager always...
2
11789
by: BG | last post by:
We're having trouble writing the code to update a UI control (label.Text) from a secondary thread. We're using C# with Windows Forms. We have a main form named MainForm, a splash screen form named SplashScreen, and a C# class library named BackgroundProcess.
3
1039
by: Wilfried Mestdagh | last post by:
Hi, I'm trying to move a secondary form to the main form's center. But this does not work with the code I try. Can someone explain ? Form1 is my seond form. And this is menu item click from main form: private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { Point loc = new Point();
2
7326
by: Ant | last post by:
Hello, How do you load a new secondary form in C#. This is the VB form style: ' Declare & instantiate Dim form2 As New Form2() ' Then Show it form2.Show() Thank you iin advance Ant
3
3770
by: Dale Lundgren | last post by:
I have a c# class library that launches a Win Form in a secondary thread. From the Form (now running in the secondary thread) I need to be able to start a method that is defined in the class and have it run in the main thread. I have read many examples and tried numerous approaches based on delegates all of which will launch the method, but never in the main thread, always in the secondary thread. Is what I'm trying to accomplish...
6
1163
by: John Dann | last post by:
I have a main form and then a secondary form that allows entry of some settings. I want to show the secondary form modally (I guess using ..ShowDialog), but I'd like it shown against the background of the main form. At present using frm2.showdialog eg from a main form menu click causes the main form to disappear from the background, which is a little disorientating for the user. Is this the standard behaviour of ShowDialog or have I got...
4
8096
by: Zorpiedoman | last post by:
In a multi-monitor environment, a form I am creating at run time keeps placing itself on the primary screen, even if the main form of the program making the call is on the secondary screen. How do I place a form on the secondary screen (monitor)? -- --Zorpie
10
44087
by: =?Utf-8?B?UmljaA==?= | last post by:
A lot of users at my workplace use different screen resolutions, and I build apps to use 1680 x 1050 pixels res by default. But some users are using 800 x 600, and the apps are too large for their screen. I used to write code in Java a few years ago (2005), and you could stretch a form with the mouse and all the controls and fonts would resize to larger or smaller size. Does .Net framework 3.5 support this kind of functionality? Or -...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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
10327
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10151
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
9950
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...
0
8973
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
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

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.