Jason Bayldon
Jason Bayldon

Reputation: 1296

Dealing with user control readbility

I have a custom user control that I have created for tracking time entries. The control consists of two panels in a table layout. The first panel contains the labels/name/user info, the second panel contains the data entry textboxes. This control at runtime is added to a flow layout panel in a form, which is contained inside a table layout panel for sizing reasons. Because of possible differences in resolution and screen sizes, I have set the autoscroll property of the flow layout panel to true. I do get the scrollbars when the control is being cut off so this works as expected.

The only issue so far is with readability. For example:

Form Example with Control

As depicted in the attached image, the username is populated in the top-left hand corner. If you need to scroll right, you cannot see the name in the left-most panel. I would like to be able to show the username on some empty space at the bottom of the control. I imagine something like this could work (mockup):

Form Example Mockup

Or I would like the ability to keep the left most panel static. Right now the flow layout panel is handling the autoscroll, which I think should be handled differently (meaning the form size should force the control to auto-scroll only the second panel, and leave the first panel intact, but this may mean that only that individual control can scroll?). What do I need to do to achieve this?

Upvotes: 0

Views: 665

Answers (1)

User999999
User999999

Reputation: 2520

Have you considered the usage of a Splitcontainer and its SplitterDistance/FixedPanel property

MSDN - Link

Another Usefull link

here is a good 'Tutorial':

Splitcontainer tutorial

The Fixedpanel property isn't discussed though. The Fixed panel should be set to the Panel that isn't supposed to change. In your case, you would point to panel on the left hand side.

Upvotes: 3

Related Questions