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

  • Home
  • SEARCH
  • 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 225311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:24:03+00:00 2026-05-11T19:24:03+00:00

I have a tabcontrol with several tabpages. I also have hooked into the InputPanel.EnabledChanged

  • 0

I have a tabcontrol with several tabpages. I also have hooked into the InputPanel.EnabledChanged event so that the tabcontrol resizes when the inputpanel is enabled. What I would like to do is ensure that the control with the focus is visible when the tabpage is resized. What’s the best way to accomplish this. Note that I am using the .NET Compact Framework.

Thanks,
MrB

  • 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-11T19:24:03+00:00Added an answer on May 11, 2026 at 7:24 pm

    You have a couple of things you need to/may want to keep track of here:

    • Current scroll position
    • Position of the tapped element (I assume a textbox) when they tapped it

    Note that the EnabledChanged event for the InputPanel is pretty easy to deal with (I assume you’ve already done it): check the InputPanel’s Enabled state and do a += or -= to the tabcontrol’s Height so the InputPanel doesn’t cover anything up.

    My understanding is that your issue is really to determine where the textbox was, because your worst-case scenario is that it will be moved off-screen when the tabcontrol resizes.

    I believe (not 100% certain) that resizing a tabcontrol will keep the top of the tabcontrol contents visible and you’ll have to scroll down to see anything that is now “covered” by the InputPanel.

    What you’ll want to do in the EnabledChanged event is find out the location of the control that was tapped (or the screen coordinate that was tapped – whatever is easiest for you). If it falls within the danger zone of (ClientSize.Height-InputPanel.Bounds.Height,ClientSize.Height), you’ll need to adjust your scroll.

    This is half-C#-half-pseudocode but you should be able to see where I’m going with it:

    int yOffset = top y-coordinate of the tapped control;
    if ( yOffset > ClientSize.Height-inputPanel.Bounds.Height )
    {
       int yShift = amount to shift everything up;
       Point scrollPosition = AutoScrollPosition;
       scrollPosition.Y = scrollPosition.Y – yShift;
       AutoScrollPosition = scrollPosition;
    }

    What this does, in a nutshell, is checks if your InputPanel is going to cover up the desired control, and if so, scroll up by yShift pixels, where yShift might be the whole height of the inputPanel, or just enough to barely show your control (whatever you want).

    • .NET CF seems very forgiving about setting invalid scroll rules. If you can only scroll up 10 pixels and you tell it to scroll up 100, it will stop at 10.
    • Screen coordinate (0,0) is the top left of the visible screen – NOT the form being displayed. You can get tripped up if you assume that (0,0) is the top of your form.

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

Sidebar

Ask A Question

Stats

  • Questions 157k
  • Answers 157k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think you want the InnerXml property instead of InnerText.… May 12, 2026 at 10:59 am
  • Editorial Team
    Editorial Team added an answer You can get, and compare the SQL for, those queries:… May 12, 2026 at 10:59 am
  • Editorial Team
    Editorial Team added an answer from datetime import datetime def copyright_dates(start_year = datetime.now().year): return "… May 12, 2026 at 10:59 am

Related Questions

I'm having some problems with a datagridview element I'm using in VS2008. This DataGridView
Say for instance I have a C# Winforms applciations that uses a tabcontrol with
I'm new to C# and I've been working on a small project to get
I have a WPF TabControl with two TabItems. Each TabItem contains a ListBox with

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.