Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 beginners questions

Status
Not open for further replies.

Oostwijk

Technical User
Oct 19, 2003
82
NL
1. I've made a program, when I compile or test the program it takes the whole screen, while it should take only half the screen. How can I adjust the width and height the program uses ? I've allready altered height and width in the form properties but that didn't work.

2. How can I check on which operating/pc systems (like mac/linux/windows xp) my program runs ?
 
1. Check the WindowsState property, it may be set to Maximize.

2. Will have to look into that more.

Becca

Somtimes, the easy answer is the hardest to find. :)
 
checked the Windowstate property, it is at normal.
 
1.Is it your source code? Check the form load event or place this in your code...

Private Sub Form_Load()
Me.Width = Screen.Width / 2
Me.Height = Screen.Height / 2
End Sub

2.You are designing windows programs yes? There's your answer!
 
Hi Lplates

1. The code you gave me makes the screen smaller, but it's too small now. Is there a way to define the number of pixels for width and height ? Here is the code that was in my form_load:

Private Sub Form_Load()
Me.Left = GetSetting(App.Title, "Settings", "MainLeft", 1000)
Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000)
Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 3500)
Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 3500)
End Sub

2. Ok, so it will run ok in Windows XP, but not on Unix,linux, macintosh ?
 
1. Im guessing that in your form unload event you have a similar code to the form load event whereby it saves the size of the form upon exiting, using the original code, run the project, after it opens, resize the form. Now close the project and reopen it, the form is the same size as when you closed it, yes?
If this is the case it means that when it is first opened on a new computer it will open at the default settings: width 3500, height 3500.

So basically there is no need to alter your code, just be aware of the settings being saved/retrieved.

2. With a special application you can get windows programs to run on redhat linux, but ordinarily they will only run on windows.

Hope it helps!
 
1. Ok, but when I change the 3500 to let's say 200 nothing happens, it still takes the whole screen.

2. Thanks for answering.
 
Ok, when it takes the whole screen, either restore or drag it smaller to the size you want, close the app, then re open it, it should be at the size it was when you closed it.
The 3500 is a default setting that will be used if no settigns can be found in the registry.

..does this work?
 
I dragged it... and it has the right width and height now. Thanks !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top