473,409 Members | 2,056 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,409 software developers and data experts.

Static forms - object created at runtime?

If I make a windows form static, does the object get instantiated at
runtime, or is a null reference made to the object? I do apologise in
advance if this is a tad ambiguous. I dont think I really understand
what a static object is.
Nov 16 '05 #1
5 1856
On Thu, 01 Jul 2004 18:30:35 +1000, The Real Andy
<.pearson@wayit_dot_com_dot_au_remove_the_obvious_ to_reply> wrote:
If I make a windows form static, does the object get instantiated at
runtime, or is a null reference made to the object? I do apologise in
advance if this is a tad ambiguous. I dont think I really understand
what a static object is.


Actually, is it possible to have a static form? I just tried and it
doesn't seem to work.

Nov 16 '05 #2
You can use static reference to your form such as:

public static Form1 ThisForm;

class Form1
{
public Form1()
{
ThisForm = this;
}
}

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "
"The Real Andy" <.pearson@wayit_dot_com_dot_au_remove_the_obvious_ to_reply>
wrote in message news:sa********************************@4ax.com...
On Thu, 01 Jul 2004 18:30:35 +1000, The Real Andy
<.pearson@wayit_dot_com_dot_au_remove_the_obvious_ to_reply> wrote:
If I make a windows form static, does the object get instantiated at
runtime, or is a null reference made to the object? I do apologise in
advance if this is a tad ambiguous. I dont think I really understand
what a static object is.


Actually, is it possible to have a static form? I just tried and it
doesn't seem to work.

Nov 16 '05 #3
On Thu, 1 Jul 2004 12:10:09 +0300, "Tamir Khason"
<ta**********@tcon-NOSPAM.co.il> wrote:
You can use static reference to your form such as:

public static Form1 ThisForm;

class Form1
{
public Form1()
{
ThisForm = this;
}
}


OK, got that. Now is an instance of that form created at runtime, or
is it just a null reference to that form?
Nov 16 '05 #4
It will be static reference to the exemplar of the form

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "
"The Real Andy" <.pearson@wayit_dot_com_dot_au_remove_the_obvious_ to_reply>
wrote in message news:1n********************************@4ax.com...
On Thu, 1 Jul 2004 12:10:09 +0300, "Tamir Khason"
<ta**********@tcon-NOSPAM.co.il> wrote:
You can use static reference to your form such as:

public static Form1 ThisForm;

class Form1
{
public Form1()
{
ThisForm = this;
}
}


OK, got that. Now is an instance of that form created at runtime, or
is it just a null reference to that form?

Nov 16 '05 #5
On Thu, 1 Jul 2004 13:07:29 +0300, "Tamir Khason"
<ta**********@tcon-NOSPAM.co.il> wrote:
It will be static reference to the exemplar of the form


Thank you very much Tamir.
Nov 16 '05 #6

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

Similar topics

9
by: Neil Kiser | last post by:
I'm trying to understand what defining a class as 'static' does for me. Here's an example, because maybe I am thinking about this all wrong: My app will allows the user to control the fonts...
15
by: Sharon | last post by:
I’m trying to build a generic Publisher-Subscriber that will work over the net, so I’m using the Remoting. I wish that the subscriber user will be notify about the messages sent by the...
2
by: superseed | last post by:
Hi, I'm pretty new to C#, and I'm quite stuck on the following problem. I would like to add to my application a Windows.Form (singleton) on which I could display a message of one of the...
6
by: Jon Davis | last post by:
I like the drag-and-drop accessibility of dragging a table to a Web Forms designer and seeing a SqlDataAdapter automatically created for me.. being able to create a DataSet from that is fun and...
11
by: Kevin Prichard | last post by:
Hi all, I've recently been following the object-oriented techiques discussed here and have been testing them for use in a web application. There is problem that I'd like to discuss with you...
10
by: morangolds | last post by:
Hi, I've been having a problem with C++ Windows Forms apps not "ending" when you close the form window. I've searched about this problem all over the place and most searches have lead me to...
2
by: seanjones | last post by:
I'm building a simple C# Win App to monitor some directories and then kick of some processes - when files hit the system. Right now everything works except that i have a listView control on a...
49
by: Ben Voigt [C++ MVP] | last post by:
I'm trying to construct a compelling example of the need for a language feature, with full support for generics, to introduce all static members and nested classes of another type into the current...
6
by: VSP | last post by:
Hello, I am just implementing singleton pattern in various ways. In one implementation I created a static member and returning that static member in the getInstance() function. I have made...
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
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...
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
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.