Scroll controls in a TableLayoutPanel using code
-
Hello ! I have a TablelayoutPanel with 1 row and some columns . I have added some controls on it. The problem is that some controls are out of Maximum visible area of TableLayoutcontrol. To resolve this problem I have added 2 special buttons that should perform Previous and Next. Between them , are the controls that I need. Now how can I do that when I click the next button , to make hidden the first Control and to show anoher control before the Next Button. For example : < Control1 Control2 Control3 > The user press the > button < Control2 Control3 Control4 > Thank you !
-
Hello ! I have a TablelayoutPanel with 1 row and some columns . I have added some controls on it. The problem is that some controls are out of Maximum visible area of TableLayoutcontrol. To resolve this problem I have added 2 special buttons that should perform Previous and Next. Between them , are the controls that I need. Now how can I do that when I click the next button , to make hidden the first Control and to show anoher control before the Next Button. For example : < Control1 Control2 Control3 > The user press the > button < Control2 Control3 Control4 > Thank you !
You need to reset the location properties of each control every time the left or right button is pressed. However, I would suggest that you would be better redesigning your form. Most users hate having to jump through hoops like this just to do their work.
-
Hello ! I have a TablelayoutPanel with 1 row and some columns . I have added some controls on it. The problem is that some controls are out of Maximum visible area of TableLayoutcontrol. To resolve this problem I have added 2 special buttons that should perform Previous and Next. Between them , are the controls that I need. Now how can I do that when I click the next button , to make hidden the first Control and to show anoher control before the Next Button. For example : < Control1 Control2 Control3 > The user press the > button < Control2 Control3 Control4 > Thank you !
The TableLayoutPanel isn't really a visible control. It's a kind of framework that add properties to the controls it "contains" and modifies the functionality of the layout properties of those controls. If it were me that had to implement some kind of side-scrolling, I'd put the TableLayout and controls on a Panel control the width required to accommodate all of the controls, then stick that in another Panel that is the width of the viewable area and set it's AutoScroll property to True. But, I wouldn't be doing something like this unless I absolutely had no other choice. It's a kludge design that makes your application a bit harder to use and visualize data.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
Hello ! I have a TablelayoutPanel with 1 row and some columns . I have added some controls on it. The problem is that some controls are out of Maximum visible area of TableLayoutcontrol. To resolve this problem I have added 2 special buttons that should perform Previous and Next. Between them , are the controls that I need. Now how can I do that when I click the next button , to make hidden the first Control and to show anoher control before the Next Button. For example : < Control1 Control2 Control3 > The user press the > button < Control2 Control3 Control4 > Thank you !
Aren't Control1 .. Control
_n_
the buttons to select the result pages 1 .. n for your DataGridView? In that case I would suggest not creating n buttons but just three (or how many you want to show at maximum) and change their display-text and click-"interpretation" dynamically. So after a click on next, Control1 will change its displayed text from 1 to 2 and when clicked would trigger page 2 to be shown instead of page 1, etc. -
Aren't Control1 .. Control
_n_
the buttons to select the result pages 1 .. n for your DataGridView? In that case I would suggest not creating n buttons but just three (or how many you want to show at maximum) and change their display-text and click-"interpretation" dynamically. So after a click on next, Control1 will change its displayed text from 1 to 2 and when clicked would trigger page 2 to be shown instead of page 1, etc. -
sorry , but these are not buttons. this question is not related with my previous questions. These are different controls( Most of them are TextBox and Combobox )
Alright, nevermind then :) But I have to agree with Richard and Dave - I wouldn't recommend doing that. Wouldn't it be possible to just show all controls at once?