//“当前警报”panel的UI初始化 private void AlarmPanelUIInitialization(int xLocation, int yLocation, int width, int height) { //panel定位 WinformUILayoutHelper.SetControlPosition(this.panelAlarmCurrent, xLocation, yLocation, width, height); WinformUILayoutHelper.SetControlPosition(this.panelAlarmHistory, xLocation, yLocation, width, height); int xPadding = 4; int yPadding = 4; int xlocation = xPadding; int ylocation = yPadding; int labWidth = width - 2 * xPadding; int labHeight = 60; int gridViewWidth = width - 2 * xPadding; int gridViewHeight = height - yPadding - labHeight; //panel中的label定位 WinformUILayoutHelper.SetControlPosition(this.labCurrentAlarm, xlocation, ylocation, labWidth, labHeight); WinformUILayoutHelper.SetControlPosition(this.labHistoryAlarm, xlocation, ylocation, labWidth, labHeight); //panel中的datagridview定位 ylocation = ylocation + labHeight + 2 * yPadding + 1; //WinformUILayoutHelper.SetControlPosition(this.gridViewAlarmCurrent, xlocation, ylocation, labWidth, gridViewHeight); //WinformUILayoutHelper.SetControlPosition(this.gridViewAlarmHistory, xlocation, ylocation, labWidth, gridViewHeight); //panel中的listbox定位 WinformUILayoutHelper.SetControlPosition(this.listBoxAlarmCurrent, xlocation, ylocation, labWidth, gridViewHeight); WinformUILayoutHelper.SetControlPosition(this.listBoxAlarmHistory, xlocation, ylocation, labWidth, gridViewHeight); }
//右部工具栏UI初始化 private void ToolUIInitialization(int xLocation, int yLocation, int width, int height) { WinformUILayoutHelper.SetControlPosition(this.panelTool, xLocation, yLocation, width, height); int buttonHeight = 60; //“当前报警” WinformUILayoutHelper.SetControlPosition(this.radBtnAlarmCurrent, 0, 0, width, buttonHeight); //“历史报警” WinformUILayoutHelper.SetControlPosition(this.radBtnAlarmHistory, 0, buttonHeight, width, buttonHeight); }