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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:12:28+00:00 2026-05-21T11:12:28+00:00

Does anyone know whether it is possible to programmatically determine the dimensions of the

  • 0

Does anyone know whether it is possible to programmatically determine the dimensions of the thumb of a System.Windows.Forms.TrackBar. (By thumb I mean the bit you drag around!)

I know you can get things like scrollbar widths from the System.Windows.Forms.SystemInfo class but there doesn’t seem to be anything for trackbars.

Thanks.

  • 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-21T11:12:28+00:00Added an answer on May 21, 2026 at 11:12 am

    The thumb size can be obtained by sending the TBM_GETTHUMBRECT message to the TrackBar control. There is no way to do that directly from C#, but you can define the appropriate Win32 structures and p/invoke SendMessage():

    [StructLayout(LayoutKind.Sequential)]
    public struct RECT
    {
         public int Left;
         public int Top;
         public int Right;
         public int Bottom;
    }
    
    [DllImport("user32.dll")]
    static extern void SendMessage(IntPtr hwnd, uint msg, IntPtr wp, ref RECT lp);
    
    private const uint TBM_GETTHUMBRECT = 0x419;
    
    // Implemented as an extension method.
    public static RECT GetThumbRect(this TrackBar trackBar)
    {
        RECT rc = new RECT();
        SendMessage(trackBar.Handle, TBM_GETTHUMBRECT, IntPtr.Zero, ref rc);
        return rc;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know if it is possible to reliably determine (programattically C/C++...) whether or
Does anyone know if it is possible to detect whether the browser has closed
Does anyone know whether it's possible to modify the workflow actions of a SharePoint
Does anyone know whether it is possible to make rewrite rules which use the
Does anyone know whether it is possible (theoretically or in reality) to use the
Does anyone know whether it is possible to change the tab order that tabs
Does anyone know whether if its possible to insert binary data into an SQL
Does anyone know whether it is possible to play a video that was synched
Does anyone know whether it's possible to stop Visual Studio 2010 from rearranging its
Does anyone know whether there's a way to mock Entity Data Provider so Unit

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.