Link to home
Start Free TrialLog in
Avatar of Dynotoe
Dynotoe

asked on

C# -- Determining the dimensions of the users screen that a form is launched on and making the forms dimensions 1/4 the screen area.

Hi folks,


Hi I am fairly new to programming so if you could show me by code example and very plain english of what it is doing I would appreciate it very much.  Anyway...

I was wondering.  I am writing an app where I want to launch a form with the width of the form 1/2 the width of the users screen (pixels I guess) and 1/2 the height for a total of exactly 1/4 the surface area of the computer screen the app is run on.

Also how could I (what would the code look like if I wanted to launch it at a specific position.

Lastly, how can I (in code) tell if there are X number of instances of a particular form so that if let's say I had 9 instances instead of 4 (example of 1/2 dimension and 1/4 surface area example) I could have the the nine forms tiled (3X3) so that the width and hight of each form would be reset (if user presses a button of course  :)   ) to 1/3 with each form taking up 1/9th of screen size (resolution/pixels whatever)

event   buttton press
how many instances of a form are there...
equally size each by users screen size...
tile them approprietly etc...

The example of stuff I am trying to figure out above is to tile windows of a financial charting application etc.


Please allow me to express my huge thanks in advance for your efforts.

Regards,

Dynotoe
Avatar of MOH_R
MOH_R

your problem be solved if I show you a code to get the Screen Resolution ( such as 800 x 600 or other ) ?
SOLUTION
Avatar of Wim_Bl
Wim_Bl
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dynotoe

ASKER

hi Wim_BL,

I'm not familiar with

"with

end with"

is this VB?  What is it in C#?  Also.. How does your code work with my code (can you incorporate it)  

FYI....Form3 is the form I want to size.  Form2 calls the method in Form1 that lauches form3 by this type of code...

Form3 f3 = new Form3();
f3.Show();

where does your code come in?  should I place the sizing in the form3 load event instead?

Lastly is there any code that can reference and return the number of instances of form3 that are running in runtime mode?

Thanks for the qucik response.


Best,

Dynotoe
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial