CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Guest

    Form Design time Height

    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


  2. #2
    Guest

    Re: Form Design time Height

    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
    [email protected]



  3. #3
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: Form Design time Height

    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
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

  4. #4
    Guest

    Re: Form Design time Height

    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


  5. #5
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: Form Design time Height

    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
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

  6. #6
    Guest

    Re: Form Design time Height

    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







  7. #7
    Guest

    Urgently Need Help on this

    Urgently Need Help on this Design time form height


  8. #8
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: Urgently Need Help on this

    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
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

  9. #9
    Guest

    Re: Urgently Need Help on this

    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.


  10. #10
    Guest

    Re: Urgently Need Help on this

    Is this the best i can get well to give u fair idea
    in VC++ you have a function Precreatewindow()


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured