C# SplitContainer控件实现缩小展开面板;C# SplitContainer控件实现缩小展开面板,直接乘坐图中的代码
privatevoidbutton1_ click (对象发送器,EventArgs e ) split container1. panel2collapsed=! split container1. panel2collapsed; 分割容器1.panel2collapsed (if ) button1. top=button1. location.ysplitcontainer1. height -分割容器1.heit trip1. location.ysplitcontainer1. height-split container1. splitter distance; button1. background image=image.from file (arrow _ down.png ); //button1. background image=split container.properties.resources.arrow _ down; } else { button1. top=button1. location.y-(剥离容器1.height-split container1. splitter distance ); statusstrip1. top=statusstrip1. location.y-(split container1. height-split container1. splitter distance ); //button1. background image=image.from file (arrow _ up.png ); button1. background image=split container.properties.resources.arrow _ up; }展开效果:
折叠效果:
图标:箭头