473,396 Members | 2,029 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.

Resizing a form on a specific monitor, before it is visible.

The following code works if the form is already visible.

Size sizeMon = SystemInformation.PrimaryMonitorSize;
Rectangle virtScrn = SystemInformation.VirtualScreen;
this.Size = sizeMon; // make it full size of one monitor
Point loc = new Point(virtScrn.Left, virtScrn.Top); // put it to the
far left monitor
this.Location = loc;
this.WindowState = FormWindowState.Maximized; // maximize it

But, not inside the c'tor, after InitializeComponent() is called,
before the form is visible. I want it to move before it is visible,
so you can't see it move.

Zytan

Apr 13 '07 #1
2 1525
I should note that this works before it is visible:

// make it full size of one monitor
Size sizeMon = SystemInformation.PrimaryMonitorSize;
this.Size = sizeMon;

And this works before it is visible:

// maximize it
this.WindowState = FormWindowState.Maximized;

It is only this that doesn't work before it is visible:

// put it to the far left monitor
Rectangle virtScrn = SystemInformation.VirtualScreen;
Point loc = new Point(virtScrn.Left, virtScrn.Top);
this.Location = loc;

Zytan

Apr 13 '07 #2
It is only this that doesn't work before it is visible:
>
// put it to the far left monitor
Rectangle virtScrn = SystemInformation.VirtualScreen;
Point loc = new Point(virtScrn.Left, virtScrn.Top);
this.Location = loc;
Solved it thanks to:
http://forums.whirlpool.net.au/forum...fm/444877.html

stovellp said: "I believe you can set the location in the constructor,
but you need to take special care to position the form manually by
setting the StartPosition property:

this.StartPosition = FormStartPosition.Manual;
this.Location = new Point(
SystemInformation.WorkingArea.Widt*h - Width,
SystemInformation.WorkingArea.Heig*ht - Height); "

Zytan

Apr 13 '07 #3

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

Similar topics

1
by: Caesar Augustus | last post by:
Greetings all! Before I ask a question I will try to provide a little background. I am currently working on an app(PD) that is essentially a search engine to find specific records. Once the...
2
by: Mike | last post by:
I'm sure this has been covered before in the newsgroup but have had no luck locating it. I have two tables: InstMonitors & MonModDesc Structure of MonModDesc: Model, Description Structure...
11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
1
by: Benz. | last post by:
Hello all, I'm having a very strange problem. I've an MDI application with many child forms. In 1 of my Child forms (Say frmA), I've a few design time controls. The forms Autoscroll property is...
1
by: Eric Wong | last post by:
Using Tkinter, I have a Canvas with vertical Scrollbar attached. At runtime, I dynamically create Checkboxes on the Canvas, each one on a different row. When I add a lot of Checkboxes, instead of...
1
by: Tombo | last post by:
I've been studying this solution, yet can not duplicate. http://www.thescripts.com/forum/thread351439.html I have a form with a single button. When the button is clicked, I want Internet...
0
by: Stroumfs | last post by:
Hello everyone! My problem is the following. i have a form called frmmain and two group boxes1 and grpbox2 I want my form to have dimension300 x 400. and each time that i make visible one...
15
by: Angelo | last post by:
Hi all, I'm using a FileSystemWatcher to monitor a directory. I want the FSW to pop up my already instantiated but invisible form. However, I'm running into some problems with this. 1) In...
9
by: RvGrah | last post by:
I'm completely new to using background threading, though I have downloaded and run through several samples and understood how they worked. My question is: I have an app whose primary form...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...

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.