Results 1 to 10 of 10

Thread: Objects on form resize on maximize

  1. #1
    Hyperactive Member gmatteson's Avatar
    Join Date
    Feb 02
    Location
    Rhode Island, USA
    Posts
    293

    Objects on form resize on maximize

    When the user maximizes the form, how do i have the objects also resize to fit the form?
    Example. if i maximize the form the frame enlarges, but the command buttons dont enlarge they just stay the same size but get reposisitioned on the form when it gets enlarged.

  2. #2
    PowerPoster
    Join Date
    Aug 00
    Location
    IN SILENCE
    Posts
    6,441

    Well

    You have to perform a grow routine. If the form width is now three times as large as it was befor it was maximized, then increase the width of a textbox, etc... by the same factor.

    This is only in theory, but it sounds right.
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  3. #3
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 02
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    Re: Well

    Originally posted by James Stanich
    You have to perform a grow routine. If the form width is now three times as large as it was befor it was maximized, then increase the width of a textbox, etc... by the same factor.

    This is only in theory, but it sounds right.
    It is right. Same goes for alignment, btw.

  4. #4
    New Member
    Join Date
    Aug 12
    Posts
    6

    Post Re: Objects on form resize on maximize

    Quote Originally Posted by Neena20 View Post
    I have a similar situation with windows form maximized and All the controls on my form should scale based on the size of the form when the form is maximized. Should I do in the form_resize event?

    Thanks,
    neena
    I have a flow layout panel,multiple controls on this panel, report viewer (of rdlc report) on another panel as one of the many controls on the form.Should I do in the form_resize event?
    Last edited by Neena20; Aug 30th, 2012 at 11:11 AM. Reason: Belong to VB.net forum

  5. #5
    Frenzied Member
    Join Date
    Jan 09
    Location
    Watch Window(Shift+f9)
    Posts
    1,434

    Re: Objects on form resize on maximize

    In vb.net there is dock property when frame size will resize automatically button will resize with respect to frame .but you are out of luck in vb6 .at design time .doing something like that .

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 02
    Posts
    21,787

    Re: Objects on form resize on maximize

    Is this in .NET or VB6? ... makes a HUGE difference.... if we're talking about VB6, then you'll need to write a resize routine as previously explained... but in .NETyou can sue a combination of the Anchor and Dock properties to achieve the resizing.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.-I also subscribe to all threads I participate, so there's no need to pm when there's an update.*
    *Proof positive that searching the forums does work: View Thread *
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *
    * Use Offensive Programming, not Defensive Programming. * On Error Resume Next is error ignoring, not error handling(tm).
    "There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN

  7. #7
    Frenzied Member
    Join Date
    Jan 09
    Location
    Watch Window(Shift+f9)
    Posts
    1,434

    Re: Objects on form resize on maximize

    yep ,there is no other option rather than sizing in resize event of form in vb6 .

  8. #8
    New Member
    Join Date
    Aug 12
    Posts
    6

    Re: Objects on form resize on maximize

    Thanks for the reply.I am doing it in vb.net.I already tried the dock and anchor properties,but,these are not enough,I also need to verify,calculate, and provide the width and height of the controls like how we do for in the run time...in case of maximized form. I apologize,I had moved this to vb.net forum.I posted it in VB forum as I have seen related previous questions about the controls resize.

  9. #9
    Frenzied Member
    Join Date
    Jul 01
    Location
    Tucson, AZ
    Posts
    1,814

    Re: Objects on form resize on maximize

    Moderator: I believe this thread needs to be moved to the NET forum.

  10. #10
    Frenzied Member
    Join Date
    Jan 09
    Location
    Watch Window(Shift+f9)
    Posts
    1,434

    Re: Objects on form resize on maximize

    yes, this thread really moved to vb.net section of vbforums.

Posting Permissions

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