I wanted to be able to hide part of my application win开发者_如何学编程dow to display only the 3 buttons at the bottom and the status bar.
Currently I was trying to do it by changing the heigth of the window but it does not seem like a correct way to do this.
For example if I have a windows form that has a menu bar, a status bar, and between the both i have a listview and the 3 buttons near the bottom, changing the height of the window will allow the user to risize it, will not show the buttons as there was the listview before so it would show only part of the list view and the status bar.
Here is an example of what it happens if i use the height resize:
Not so far from how I wanted it to look like but the buttons are missing and I would need to lock the window so the user can't resize it.
1) Make sure the three buttons have the Anchor property set to "Bottom, Right".
2) Set the form's FormBorderStyle to "FixedSingle" (or similar, see http://msdn.microsoft.com/en-us/library/system.windows.forms.form.formborderstyle.aspx). Set the form's SizeGripStyle to "Hide".
3) To change the height:
Smaller: this.Height -= listView.height;
Larger: this.Height += listView.height;
Hope this helps.
It sounds like you're looking for the MinimumSize
property.
How about setting the anchor property of listview to left, right, top and bottom, and setting the anchor property of buttons to right + bottom?
精彩评论