0

我昨天问了一个问题供参考:跟踪 40 多个控制值

我将一堆控件绑定到一个属性类;但是,它确实减慢了应用程序的 GUI 部分。例如,使用以下代码:

        numericUpDownPhysicalAIs.DataBindings.Add("Value", configurationValues, "PhysicalAIs");
        numericUpDownInternalAIs.DataBindings.Add("Value", configurationValues, "InteralAIs");
        numericUpDownPhysicalAOs.DataBindings.Add("Value", configurationValues, "PhysicalAOs");
        numericUpDownInternalAOs.DataBindings.Add("Value", configurationValues, "InternalAOs");
        numericUpDownSetpoints.DataBindings.Add("Value", configurationValues, "Setpoints");
        numericUpDownIndexRegisters.DataBindings.Add("Value", configurationValues, "IndexRegisters");
        numericUpDownNetworkID.DataBindings.Add("Value", configurationValues, "NetworkID");
        numericUpDownQuiescentOperationStartupDelay.DataBindings.Add("Value", configurationValues, "QuiescentOperationStartupDelay");
        numericUpDownQuiescentTelemetryTable.DataBindings.Add("Value", configurationValues, "QuiescentTelemetryTableScanRate");
        numericUpDownPercentQuiescentThreshold.DataBindings.Add("Value", configurationValues, "PercentQuiescentThreshold");
        numericUpDownPercentageOfQuiescentInterval.DataBindings.Add("Value", configurationValues, "PercentQuiescentInterval");
        numericUpDownAODayWeek.DataBindings.Add("Value", configurationValues, "AODayWeek");
        numericUpDownAODayMonth.DataBindings.Add("Value", configurationValues, "AODayMonth");
        numericUpDownAOMonthYear.DataBindings.Add("Value", configurationValues, "AOMonthYear");
        numericUpDownAOYear.DataBindings.Add("Value", configurationValues, "AOYear");
        numericUpDownTimeDay.DataBindings.Add("Value", configurationValues, "TimeDay");
        numericUpDownDebugStatementNumberSetpoint.DataBindings.Add("Value", configurationValues, "DebugStatementNumberSetpoint");
        numericUpDownTelemetryControlSetpoint.DataBindings.Add("Value", configurationValues, "TelemetryControlSetpoint");
        numericUpDownCommunicationFailDI.DataBindings.Add("Value", configurationValues, "CommunicationFailDI");
        numericUpDownCommunicationFailAddressAO.DataBindings.Add("Value", configurationValues, "CommunicationFailAddressAO");
        numericUpDownAddressUnreachableAO.DataBindings.Add("Value", configurationValues, "AddressUnreachableUnitAO");
        numericUpDownPowerCountAO.DataBindings.Add("Value", configurationValues, "PowerCountAO");
        numericUpDownResetCountAO.DataBindings.Add("Value", configurationValues, "ResetCountAO");
        numericUpDownRandomNumberAO.DataBindings.Add("Value", configurationValues, "RandomNumberAO"); 

表单显示所有向上/向下数字框需要 30 秒到一分钟的时间。如果我将此代码注释掉,GUI 会立即弹出。这是 DataBindings.Add 方法的限制吗?

谢谢

4

0 回答 0