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

Thread: resize....

  1. #1
    Join Date
    May 2001
    Posts
    155

    resize....

    I have a project. When the control is resized it's supposed to resize an msflexgrid and 3 command buttons. The msflexgrid is supposed to be on top and the buttons on the bottom. I want when i resize the control it resizes the msflexgrid and the command buttons, so they appear in the same appearence just like they were as large as they were normally. Help please!

    --Ant
    --------------------------------------------------
    check out my newest freeware
    E-mail me at: [email protected]
    for the address

  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: resize....

    Your UserControl has a Resize event. In it is where you want to recalculate the left,top,width and height of each of the controls on your User Control.
    As the control is drawn on the client form at design time, this event is entered.

    John G

  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: resize....

    This code should resize the grid to show all rows and columns. Though dependent on the number of rows/cols
    and their sizes this may mean that part of the grid is off the screen.

    Dim dblH As Double
    Dim dblW As Double
    With MSFlexGrid1
    For intRow = 0 To .Rows - 1
    dblH = dblH + .RowHeight(intRow) + 22.5
    Next
    For intCol = 0 To .Cols - 1
    dblW = dblW + .ColWidth(intCol) + 45
    Next
    .Height = dblH - 22.5
    .Width = dblW - 45
    End With



    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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