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

displaying windows

Hi,
My application has 3 windows, each of them is separate form. One of
them (called MainWindow) is visible in task bar, others are not. I'd like
them to behave in the following:

1) when main window gets focus (or is "restored"), others should be brought
to the front
2) when main window is minimized, others should also be minimized (hidden?)

I thought about handling "Activated" event in MainWindow, but I don't really
have any idea what to do next.

Thanks

Piotrek Stachowicz
Nov 16 '05 #1
3 1147
Open 2 other windows as Dialogs.
Form f2 = new Form2();
f2.ShowDialog();

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "
"Piotrek Stachowicz" <dy******@poczta.onet.pl> wrote in message
news:cb**********@news.onet.pl...
Hi,
My application has 3 windows, each of them is separate form. One of
them (called MainWindow) is visible in task bar, others are not. I'd like
them to behave in the following:

1) when main window gets focus (or is "restored"), others should be brought to the front
2) when main window is minimized, others should also be minimized (hidden?)
I thought about handling "Activated" event in MainWindow, but I don't really have any idea what to do next.

Thanks

Piotrek Stachowicz

Nov 16 '05 #2
Put a reference to each window into the main Form.

somewhere in your main form class you put
(ugly stuff)

public yourWin2Class window2;
public yourWin3Class window3;

in the main form on load you do:

window2 = new yourWin2Class();
window3 = new yourWin3Class();

//Put here the initialization from your last request ;-)

window2.Show();
window3.Show();

in the resize function of the main window you do:

window2.WindowState = this.WindowState;
window3.WindowState = this.WindowState;

// And again:
//Put here the initialization from your last request ;-)

This should do it. But you should check for the WindowState == Maximized
stuff and react on this, otherwise you will get funny behaviour(I guess)

Have fun,

Martin
Piotrek Stachowicz wrote:
Hi,
My application has 3 windows, each of them is separate form. One of
them (called MainWindow) is visible in task bar, others are not. I'd like
them to behave in the following:

1) when main window gets focus (or is "restored"), others should be brought
to the front
2) when main window is minimized, others should also be minimized (hidden?)

I thought about handling "Activated" event in MainWindow, but I don't really
have any idea what to do next.

Thanks

Piotrek Stachowicz

Nov 16 '05 #3
It seems like what you want to do is make the secondary forms owned by the
main form.

ChildForm1.Owner = MainForm;
ChildForm2.Owner = MainForm;

When a form is owned by another it is activated and minimized with its
owner. In addition, owned forms are never displayed behind their owner.

Hope this helps.
- Rhy

"Piotrek Stachowicz" <dy******@poczta.onet.pl> wrote in message
news:cb**********@news.onet.pl...
Hi,
My application has 3 windows, each of them is separate form. One of
them (called MainWindow) is visible in task bar, others are not. I'd like
them to behave in the following:

1) when main window gets focus (or is "restored"), others should be
brought
to the front
2) when main window is minimized, others should also be minimized
(hidden?)

I thought about handling "Activated" event in MainWindow, but I don't
really
have any idea what to do next.

Thanks

Piotrek Stachowicz

Nov 16 '05 #4

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

Similar topics

8
by: euang | last post by:
Hi, I have been using access 2000 for two years on WINDOWS NT to display dynamic aweb page using ASP My ISP has now changed to Windows 2003, and I am having major problems displaying...
4
by: Les Juby | last post by:
Can someone please help with a suggestion as to how I can keep the formatting (carriage returns) that the user enters into a memo field and then display that later. I figured I might be able to...
3
by: Dalan | last post by:
At first I was not certain what could cause Access 97 from displaying most jpeg images, but not all. After further testing, it seemed that all original images of less than 275 pixels per inch or...
20
by: Peter E. Granger | last post by:
I'm having a strange problem (or at least it seems strange to me) trying to display a MessageBox in a VC++ .NET forms application. If I put the call to MessageBox::Show in the form's .h file, it...
0
by: Phil G. | last post by:
Hi, my 'project' requires that I create a form with text info. at set time periods. These time periods are not evenly spaced so I pass a param for the delay(seconds). In order to debug this I have...
2
by: moumita | last post by:
I have the folowing code..the logic according to me is correct..but I dont know...the msg boxes are not displaying anything...am I supposed to change any settings ??? Public Class Form1
9
by: piyush2884 | last post by:
hi guys, got anything on this issue?
12
by: korund | last post by:
How to make javascript alert with non-english text displaying correctly on computers where english only is default system & language settings? For web page the solution is just use meta tags:...
3
by: suvarnask1 | last post by:
Any one can help MEEEE .....WIndows 2000-Desktop icons not Displaying In My System After Booting process display one message "Userenv.dll is missing" after click on that not displaying the desktop...
0
by: mylog | last post by:
I have downloaded a GLEE(Graph Layout Execution Engine) and written the following code to display a windows form from a web page but i am encountering with a small problem on displaying the graph...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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:
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.