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 8061219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:15:53+00:00 2026-06-05T10:15:53+00:00

How to get the client size of a Form when it’s maximized without maximize

  • 0

How to get the client size of a Form when it’s maximized without maximize it?

From example, I want to create a Bitmap with the same size of the maximized Form‘s client size, how can I do that?

  • 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-06-05T10:15:55+00:00Added an answer on June 5, 2026 at 10:15 am

    Try

    Screen.FromControl(this).GetWorkingArea();
    

    to calculate the size (without taskbar)
    then substract the difference between the Forms ClientSize / Size.
    Hope that works, haven’t tested it.

    Update:

    A bit hacky, but I tried it and it works.

            var frm = new Form();
            frm.Opacity = 100;
            frm.WindowState = FormWindowState.Maximized;
            frm.Show();
    
            while (!frm.IsHandleCreated)
                System.Threading.Thread.Sleep(1);
    
            var result = frm.ClientSize;
            frm.Close();
            return result;
    

    Update2:

    This is a nicer solution.
    I disable painting of the Form, maximize it, get the client area, set it back to normal and return the result. Works well, without flicker or something.

        private static Size GetMaximizedClientSize(Form form)
        {
            var original = form.WindowState;
            try
            {
                BeginUpdate(form);
    
                form.WindowState = FormWindowState.Maximized;
                return form.ClientSize;
    
            }
            finally
            {
                form.WindowState = original;   
                EndUpdate(form);
            }
        }
    
        [DllImport("User32.dll")]
        private extern static int SendMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);
    
        private enum Message : int
        {
            WM_SETREDRAW = 0x000B, // int 11
        }
    
        /// <summary>
        /// Calls user32.dll SendMessage(handle, WM_SETREDRAW, 0, null) native function to disable painting
        /// </summary>
        /// <param name="c"></param>
        public static void BeginUpdate(Control c)
        {
            SendMessage(c.Handle, (int)Message.WM_SETREDRAW, new IntPtr(0), IntPtr.Zero);
        }
    
        /// <summary>
        /// Calls user32.dll SendMessage(handle, WM_SETREDRAW, 1, null) native function to enable painting
        /// </summary>
        /// <param name="c"></param>
        public static void EndUpdate(Control c)
        {
            SendMessage(c.Handle, (int)Message.WM_SETREDRAW, new IntPtr(1), IntPtr.Zero);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I get a client's address from a WCF Service Application? Also, is
How to get the total height of a windows form including non-client area? Size
Is there any other way to get file size at client side without using
I want to get content size by request.getContentLength() in server client JSP page. But
I want to know how to get client IP address using jQuery? Is it
I can't seem to get client side validation working with the version of MVC
I can't work out how to get the mysql client to return the number
I have a form that can be manipulated on the client's browser via javascript
I have a query of this form: SELECT e.date, SUM(e.size) as bytes FROM entries
I'm trying to create a Properties form for selected items from my small file

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.