473,480 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to see if a form is visible

from from 2 how can i see if form 1 is visible or not?
Aug 7 '06 #1
5 1921
Hi Gian,

Do you mean the Form.Visible property or how to determine if the form is
partially or fully covered by another window?
To be able to check the Visible property on Form 1 from Form 2 you need a
reference to it.
On Mon, 07 Aug 2006 12:48:46 +0200, Gian Paolo <no****@nospam.itwrote:
from from 2 how can i see if form 1 is visible or not?



--
Happy Coding!
Morten Wennevik [C# MVP]
Aug 7 '06 #2
i would like to reference it but i do not know how!!!!

"Morten Wennevik" <Mo************@hotmail.comha scritto nel messaggio
news:op***************@tr024.bouvet.no...
Hi Gian,

Do you mean the Form.Visible property or how to determine if the form is
partially or fully covered by another window?
To be able to check the Visible property on Form 1 from Form 2 you need a
reference to it.
On Mon, 07 Aug 2006 12:48:46 +0200, Gian Paolo <no****@nospam.itwrote:
>from from 2 how can i see if form 1 is visible or not?


--
Happy Coding!
Morten Wennevik [C# MVP]

Aug 7 '06 #3
How do you create the two forms?

If Form2 is created by Form1, pass a reference to Form1 in the
constructor. If Form1 is created by Form2, then you have reference.

class Form1
{
// constructor
public Form1()
{
}
}

class Form2
{
private Form1 form1Reference;

// constructor
public Form2(Form1 form1Reference)
{
this.form1Reference = form1Reference
}

void SomeMethod()
{
if(form1Reference.Visible)
{
// do stuff
}
}
}

On Mon, 07 Aug 2006 13:47:22 +0200, Gian Paolo <no****@nospam.itwrote:
i would like to reference it but i do not know how!!!!

"Morten Wennevik" <Mo************@hotmail.comha scritto nel messaggio
news:op***************@tr024.bouvet.no...
>Hi Gian,

Do you mean the Form.Visible property or how to determine if the formis
partially or fully covered by another window?
To be able to check the Visible property on Form 1 from Form 2 you need
a
reference to it.
On Mon, 07 Aug 2006 12:48:46 +0200, Gian Paolo <no****@nospam.itwrote:
>>from from 2 how can i see if form 1 is visible or not?


--
Happy Coding!
Morten Wennevik [C# MVP]



--
Happy Coding!
Morten Wennevik [C# MVP]
Aug 7 '06 #4
already i tryed this... from1Reference is null !!!

(using .net 2.0)

"Morten Wennevik" <Mo************@hotmail.comha scritto nel messaggio
news:op***************@tr024.bouvet.no...
How do you create the two forms?

If Form2 is created by Form1, pass a reference to Form1 in the
constructor. If Form1 is created by Form2, then you have reference.

class Form1
{
// constructor
public Form1()
{
}
}

class Form2
{
private Form1 form1Reference;

// constructor
public Form2(Form1 form1Reference)
{
this.form1Reference = form1Reference
}

void SomeMethod()
{
if(form1Reference.Visible)
{
// do stuff
}
}
}

On Mon, 07 Aug 2006 13:47:22 +0200, Gian Paolo <no****@nospam.itwrote:
i would like to reference it but i do not know how!!!!

"Morten Wennevik" <Mo************@hotmail.comha scritto nel messaggio
news:op***************@tr024.bouvet.no...
>Hi Gian,

Do you mean the Form.Visible property or how to determine if the form is
partially or fully covered by another window?
To be able to check the Visible property on Form 1 from Form 2 you need
a
reference to it.
On Mon, 07 Aug 2006 12:48:46 +0200, Gian Paolo <no****@nospam.itwrote:
>>from from 2 how can i see if form 1 is visible or not?


--
Happy Coding!
Morten Wennevik [C# MVP]



--
Happy Coding!
Morten Wennevik [C# MVP]
Aug 7 '06 #5
How do you create Form2?

Forgot to tell you to do this

// Inside Form1
Form2 f2 = new Form2(this);

Form2 should then pick up the reference to Form1 (this)

If you are doing this, can you show us some code for Form2? and how you
create Form2 in Form1?

On Mon, 07 Aug 2006 14:07:04 +0200, Gian Paolo <no****@nospam.itwrote:
already i tryed this... from1Reference is null !!!

(using .net 2.0)

"Morten Wennevik" <Mo************@hotmail.comha scritto nel messaggio
news:op***************@tr024.bouvet.no...
How do you create the two forms?

If Form2 is created by Form1, pass a reference to Form1 in the
constructor. If Form1 is created by Form2, then you have reference.

class Form1
{
// constructor
public Form1()
{
}
}

class Form2
{
private Form1 form1Reference;

// constructor
public Form2(Form1 form1Reference)
{
this.form1Reference = form1Reference
}

void SomeMethod()
{
if(form1Reference.Visible)
{
// do stuff
}
}
}

On Mon, 07 Aug 2006 13:47:22 +0200, Gian Paolo <no****@nospam.itwrote:
>i would like to reference it but i do not know how!!!!

"Morten Wennevik" <Mo************@hotmail.comha scritto nel messaggio
news:op***************@tr024.bouvet.no...
>>Hi Gian,

Do you mean the Form.Visible property or how to determine if the form
is
partially or fully covered by another window?
To be able to check the Visible property on Form 1 from Form 2 you need
a
reference to it.
On Mon, 07 Aug 2006 12:48:46 +0200, Gian Paolo <no****@nospam.it
wrote:

from from 2 how can i see if form 1 is visible or not?

--
Happy Coding!
Morten Wennevik [C# MVP]





--
Happy Coding!
Morten Wennevik [C# MVP]
Aug 7 '06 #6

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

Similar topics

6
17045
by: Matthew Wells | last post by:
I am trying to load a form (load Me) without the form becoming visible. If I try me.hide or me.visible = false, they load the form and the form blinks before becoming invisible. Is there a way to...
7
9798
by: Saintor | last post by:
What I do now is I put a value in the tag property, and using the form_current event, I run through all controls properties until the ones with the required tag value are met. Sound OK in theory,...
19
3582
by: Raposa Velha | last post by:
Hello to all! Does any of you want to comment the approach I implement for instantiating a form? A description and an example follow. Cheers, RV jmclopesAThotmail.com replace the AT with the...
3
6803
by: Susan Bricker | last post by:
Greetings. I have three forms that are open at the same time. They are related and cascading. The first form (frmEventAdd) is the anchor. Each event can have many Trials. The second form is...
0
5493
by: Benjamin Bittner | last post by:
Hallo NG, ive searched a lot in some google groups, and found many threads, but nothing that helped me. Here is the scenario: I have an aspx page which loads a user control in page.onInit like...
9
1247
by: Bob | last post by:
Hello: I have a form with 26 panels. Each panel has a bunch of other controls in it. The panels visible property are set to False. Each panel has a corosponding button to set it's visible...
8
1781
by: Hansen | last post by:
Hi I have a form with multiple labels and textboxes and listboxes that need to be made visible and not visible when buttons are clicked. Is there anyway of grouping them together so that I have...
1
3381
by: dBNovice | last post by:
Please help! I have 3 forms: Task, Subtask, Elements. Elements is a subform of Subtask and Subtask is a subform of Task. I am able to navigate from Task to Subform to Element and from Element to...
8
3997
by: Doc John | last post by:
I have an MDI container with a child Form which will be visible according to certain events. The problem is that when I set the property Visible to False and then back to True, the Form will be in...
3
2618
by: Gilberto | last post by:
Hello, I have a form with some buttons that take the user to reports, other forms, etc. On this form the user can see how many products are missing costing and pricing information, through some...
0
7039
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
6904
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
7080
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...
1
6735
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
6895
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
5326
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,...
1
4770
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...
0
4476
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...
0
1296
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 ...

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.