家用制氧机十大品牌 先上张效果图,依次为 全展开图,部分折叠图,全部折叠图 家用制氧机十大品牌 时间仓促,功能相对简单,也未经过详细测试,不支持设计期操作,这里提供思路给大家,有时间完善吧,上代码: 代码文件介绍 NavBar.cs 导航栏主体,继承自 Panel NavGroup.cs NavBar 中的分组,即(控制面板,我的电脑等),继承自 Control NavBarItem.cs 分组中的小项(即区域选项,字体等),继承自 Control NavBarButton.cs 导航栏主体右边的圆形按钮 NavGroupCollection.cs 分组的集合 NavBarItemCollection.cs 分组中小项的集合 NavGroupState.cs 组的状态,收缩还是展开 NavBar.cs [csharp] view plaincopy 1. using System; 2. using System.Collections.Generic; 3. using System.Drawing.Design; 4. using System.ComponentModel.Design; 5. using System.ComponentModel; 6. using System.Data; 7. using System.Drawing; 家用制氧机十大品牌 8. using System.Linq; 9. using System.Text; 10. using System.Windows.Forms; 11. 12. namespace WindowsApplication1 13. { 14. public partial class NavBar : Panel 15. { 16. private NavGroupCollection _groups; 17. public NavGroupCollection Groups 18. { 19. get { return this._groups; } 20. } 21. public NavGroup this[int index] 22. { 23. get 24. { 25. if (index > -1) 26. return this._groups[index]; 27. else 28. return null; 29. } 30. } 31. private int _selectedIndex = -1; 32. /// 33. /// 选择组的索引 34. /// 35. [DefaultValue(-1)] 36. public int SelectedIndex 37. { 38. get { return this._selectedIndex; } 39. set 40. { 41. this._selectedIndex = value; 42. this.SelectGroup(value); 43. } 44. } 45. private int _groupSpace = 20; 46. /// 47. /// Group 间距 48. /// 49. public int GroupSpace 50. { 51. get { return this._groupSpace; } 家用制氧机十大品牌 52. set { this._groupSpace = value; } 53. } 54. private int _groupMargin = 5; 55. /// 56. /...