Click to See Complete Forum and Search --> : Form Design time Height
April 5th, 2000, 02:21 PM
I have a VB form whose height at design time to say 800
Now at run time the form height changes because its an Mdichild .....
i cant hard code because i have to do for all forms
i basically need to get the form Design time height
Any shots at this
rgds
Satish
April 6th, 2000, 11:58 AM
Satish, Please try to make some changes in form property page.Change the window state value to 0 ( Normal window)on form property page window. I hope it will work.If still yuh have problem, let me know.
Sym13
Sym13@softhome.net
Johnny101
April 6th, 2000, 12:07 PM
MDI Parents are trying to help you out by resizing their children to a certain percentage of the available area.
To override this - set the border style of the child forms to Fixed Single - that should do it.
John
John Pirkey
MCSD
http://www.ShallowWaterSystems.com
http://www.stlvbug.org
April 6th, 2000, 12:16 PM
Hi
Thanks for replying.
But i still cant dictate what the user wants to do. Because i need to give some flexing on the grid i need the form design properties - in C++ i know there is something called PreCreateWindow where u can get all design time properties
Johnny101
April 6th, 2000, 02:13 PM
If you must allow the form to be resized at run time by the user, but don't want the MDI parent form to resize it then try adding some code to the activate event, or set a variable in the form load indicating that the has just been called and then in the resize event, check that variable and if it's true then resize the form:
Dim bFirstRun as boolean
Sub Form_Load()
...
bFirstRun = true
...
End Sub
'then the resize event fires
Sub Form_Resize()
If bFirstRun then
me.width = 800
me.height = 600
exit sub
end if
End Sub
Or something like that maybe. That should make the form come up for the first time in the dimensions you want, but still allow the user to resize the form to his liking.
hope this helps,
John
John Pirkey
MCSD
http://www.ShallowWaterSystems.com
http://www.stlvbug.org
April 6th, 2000, 02:25 PM
Well thats exactly iam doing
But i cant hard code this 800 number
i need to read from the Design time Width propery
Sub Form_Resize()
If bFirstRun then
me.width = 800
me.height = 600
exit sub
end if
End Sub
April 7th, 2000, 12:09 PM
Urgently Need Help on this Design time form height
Johnny101
April 7th, 2000, 12:59 PM
If you dont want to hard code the size of the form, then you will have to hard code a certain percentage of the screen, so that different screen sizes still display a proportionate form size. If you dont want to hard anything, then you are probably stuck with dealing with the size the mdi parent dictates.
there are some APIs (i unfortunately dont know them, but i have seen them) you could use to get the size of the screen and from then you would set the width/height to a percentage of that number.
that's as close as your gonna get with dynamic sizing.
John
John Pirkey
MCSD
http://www.ShallowWaterSystems.com
http://www.stlvbug.org
April 8th, 2000, 01:55 AM
he's right. by the way, you can use the 'sysinfo' control to attain the screen dimensions. access the system info control through the projects/components menu under VB 6.0. and using screen percentages is your best(most dynamic) bet.
April 11th, 2000, 07:13 PM
Is this the best i can get well to give u fair idea
in VC++ you have a function Precreatewindow()
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.