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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make window not sizable in it's original size?

Status
Not open for further replies.

shelbytll

Programmer
Dec 7, 2001
135
0
0
SG
hi,
how about I would like to make a FORM window size not sizable and onload, it is it's original size?

I have tried to make it's BorderStyle=1 - Fixed Single
and onload of the FORM, I code THIS.WindowState = 1

I did achieve the result I want however onload, it is always minimise on to my toolbar. Is there a better way? I am a clever newbie...[peace]
 
shelbytll

The size of the form that you load will be the size as saved.

.BorderStyle = 1 - Fixed Single will prevent the form from being resized.

It should not be necessary to alter the .WindowState, but if you need to, set .WindowState = 0 - Normal.

HTH

Chris [pc2]
 

thisform.borderstyle = 1

or

thisform.borderstyle = 2

shd do the trick


torturedmind [trooper]
"It is much better to ask shallow questions than to wander in the depths of ignorance..."
 
set windowstate to 0 - normal
set maxbutton and minbutton properties to .f.
 
Hi,

tried out all the above options and still can't solve the problem.

When "Run Form" to test it, it is ok.
However, after build to .exe and run it, it is not in it's original size. It expand. I am a clever newbie...[peace]
 
ShelbyTll

I believe I read somewhere that it's a bug/feature. Set your form borderstyle to 1 and in the Init of the form restate the sizes :
THIS.WIDTH = 200
THIS.HEIGHT = 300
Mike Gagnon
 
shelbytll

You will also get this if you set .ScrollBars to 2 or 3 - the form width will decrease with the width of the scrollbar every time you initialise it so, as Mike suggests, force the size in the .Init() event. HTH

Chris [pc2]
 
Hi,
the scrollbar is 0 (default).

Tried what Mike suggested.
However, it's still the same. I am a clever newbie...[peace]
 
shelbytll

Rename the existing form.

Create a new form without controls, save it to the old form's name, compile and test.

If that's OK, add the controls/code one by one, testing each configuration as you go.

Sooner or later, you will find what's causing the problem.

HTH

Chris [pc2]
 
HI shelbytll,

1. It is always advisable to have a basic form class of your own.. even if no code is put in that .. as your
FormBase class. Then you set all the global properties etc.. in this form .. and create all other forms as your derived forms.. I mean.. subclassed forms from this form.

If that is the case.. you can handle these type of behaviours at one place.. that is your base form.

2. Now coming to your point.. I have noticed.. that as you open and close your forms for designing.. the forms width and height property does change and behave oddly. They dont remain the same. As a result the compiled applications seem to have different size forms.. however small the differences.
To solve this .. now.. in your baseForms.. init event.. add the code..
This.Height = nhhhh
This.Width = nwww
nhhh and n to be decided based on the sizing you have done and entered in the init event.

This gets inherited in all your forms subclassed from this form. If you want to change the window state on any form.. you can do that in that form as given below... but remember to you add the DODEFAULT() in the init event of all forms.. if they have their own init event code.

To set the window state of the specific form.. put in its init event.. This.WIndowState = whatever after the DODEFAULT().

Hope this solves your problem :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top