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

The Archive Base Latest Questions

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

I have a control derived from System.Windows.Forms.UserControl which is placed in a customized grid.

  • 0

I have a control derived from System.Windows.Forms.UserControl which is placed in a customized grid. When the first column of the grid is frozen and the grid is scrolled by a few pixels, the second column becomes partially visible such that the control in this column also becomes partially visible.

To achieve this I want to be able to display only the part of the control that is visible either by hiding/clipping the left portion of the control.

I don’t want to modify OnPaint of the control as I don’t have access to the control’s code. I can change the code in the grid where the control is displayed.

I tried the following which didn’t work:
1. Invalidating only part of the control that has to be visible.
2. Using GraphicsPath as follows:

System.Drawing.Drawing2D.GraphicsPath controlPath = new System.Drawing.Drawing2D.GraphicsPath();
controlPath.AddRectangle(visibleRect);
editControl.Region = new Region(controlPath);

Any other ideas?

  • 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-28T13:22:13+00:00Added an answer on May 28, 2026 at 1:22 pm

    I got this working solution:

    Using GraphicsPath worked. I wasn’t setting the clip rectangle properly due to which I couldn’t see the clipping happen. Instead of setting the xOffset of the clip region wrt to the Grid I had to set the clip region wrt to the control.
    The window region is a collection of pixels within the window where the operating system permits drawing. The operating system does not display any portion of a window that lies outside of the window region. The coordinates of a control’s region are relative to the upper-left corner of the control, not the client area of the control( http://msdn.microsoft.com/en-us/library/ddhy6052(vs.71).aspx)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of controls derived from System.Windows.Forms.UserControl, which are then being displayed
I have a control (derived from System.Windows.Forms.Control) which needs to be transparent in some
I have my own custom control derived from System.Windows.Forms.TreeView which is present on the
I have written a control in C# that derives from System.Windows.Forms.Control. I have added
I have my own control derived from Windows.Forms.Control and I am checking the Parent.BackColor
I'd like to create a derived control from System.Windows.Forms.ComboBox that is bound to a
I'm currently designing a custom tab control class which derives from System.Windows.Forms.Control. The problem
I have a class derived from System.Windows.Controls.UserControl, and I need to add a PropertyChangedCallback
I have a windows forms project. It has a main form derived from System::Windows::Forms::Form
I have a base user control (inherited from System.Web.UI.UserControl ) public delegate void MyEventHandler(object

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.