Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 587901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:15:41+00:00 2026-05-13T15:15:41+00:00

My customer want me to change the default maximise-buttons functionality to maximise the form

  • 0

My customer want me to change the default maximise-buttons functionality to maximise the form over all screens the customer have. I have already written some code to measure the correct rectangle to put the form to, but when i assign it to the MaximisedBounds attribute of the form, there are some issures: The screen (in my 2 screen tests) that the form was not on before the click get only one paint, ans if you click on the form on the other screen it is like you have clicked “under” it onto the next window beneath.

Of course there are other ways to solve this problem (like in Event when a window gets maximized/un-maximized), i wounder if the described behaviour is a bug, or my mistake. Is there anything to do before changing the MaximisedBounds attribute to make it work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:15:42+00:00Added an answer on May 13, 2026 at 3:15 pm

    I’d agree with Matt. Setting the “MaximizedBounds” is not a good idea.
    As written in Event when a window gets maximized/un-maximized, I would override the WndProc-method. There you can handle the different received commands from your window on your own.

    The main thing to do is to write your own code for the “SC_MAXIMIZE”-windowcommand (as written in the referenced article above). There you can manually set the form’s size e.g. In this case the form won’t be really maximized. Actually is it still in normal WindowState. To prevent the user from changing this state you need to “catch” some other windowcommands.

    The overridden WndProc method could be like this:

        protected override void WndProc(ref Message m)
        {
            if(m.Msg == 0x0112) // WM_SYSCOMMAND
            {
                if(m.WParam == new IntPtr(0xF012)) //TITLE_CLICK_ONCE
                {
                    // catch, this command can occur, when form starts to move
                }
    
                if(m.WParam == new IntPtr(0xF001) // RESIZE_ON_EDGE
                || m.WParam == new IntPtr(0xF002)
                || m.WParam == new IntPtr(0xF003)
                || m.WParam == new IntPtr(0xF004)
                || m.WParam == new IntPtr(0xF005)
                || m.WParam == new IntPtr(0xF006)
                || m.WParam == new IntPtr(0xF007)
                || m.WParam == new IntPtr(0xF008))
                {
                    // catch the resizing
                }
    
                if(m.WParam == new IntPtr(0xF032)) // SECOND_CLICK_ON_TITLEBAR
                {
                    // catch. causes a maximization (or resuming to normal window-mode)
                }
    
                if(m.WParam == new IntPtr(0xF030)) //SC_MAXIMIZE
                {
                    // the actual point, where to enter your code
                    // this command occurs, when the "Maximize"-button is pressed
                }
            }
    
            // maybe abort calling of the base-method at specified window-commands,
            // when you want to make your own code by simply "return;"
            base.WndProc(ref m);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have XML: <Customer><CustomerType>Business</CustomerType><CreditRating>Good</CreditRating></Customer> <Customer><CustomerType>Residential</CustomerType><CreditRating>Good</CreditRating></Customer> and I want to change all the
i have a generic problem all over my application and want to see if
The customer want to have the following scenario: Customer hands out link (webapp address)
I have a hotel with two domains. Now the customer want a redirect: domain1.dk/folder/
I want to make customer route for url which have parameters. <a href='javascript:void(0)' onclick=window.location='<?php
I want to add a new form to the edit customer page, so far
We have a form and depending upon the circumstances we want to switch between
I have root access and want to change the identity of phone in order
I want to change the session timeout per customer. I wanna give the option
I want to change this code... <form action=search.php method=get name=form1 id=form1> <select name=name> <option

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.