CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2007
    Posts
    405

    I have no problem allowing resizing MDIForm ?

    I encountered no problems when resizing allows MDIForm, when running this code below:
    Code:

    Private mHeight As Long, mWidth As Long
    Private Sub MDIForm_Load()
    mHeight = Me.Height
    mWidth = Me.Width
    End Sub

    'disable mdi form resize
    Private Sub MDIForm_Resize()
    Me.WindowState = 0 'Normal
    Me.Height = mHeight
    Me.Width = mWidth
    End Sub


    when I press MinButton of MIDIForm not. can change the code above to just have two functions: do not allow to resize and allow MinButton (or allow MaxButton) of MDIForm it ?

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: I have no problem allowing resizing MDIForm ?

    There is no mode on a MDI form to prevent resizing.

    You could add code in the form_resize event to override any change made by the user but you need to make sure that your code only tries to override when the windowstate is normal else it will not allow the other operations and may give a run time error when min or max is clicked.

    Often when using a MDI parent I will set the size of the form to the workarea size and allow only min or max operations
    Always use [code][/code] tags when posting code.

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