private void Window_Loaded(object sender, RoutedEventArgs e) { try { _listAD0 = new List <Label>(); _listAD1 = new List <Label>(); _listAD2 = new List <Label>(); _listAD3 = new List <Label>(); _listADDark = new List <Label>(); for (int i = 0; i < Global.deviceHole.HoleCount; ++i) { UIElement element = GenerateChannelADForm(string.Empty + (i + 1)); StackPanelShowAD.Children.Add(element); } _updateADThread = new UpdateADThread(this); _updateADThread.Start(); Message msg = new Message() { what = MsgCode.MSG_READ_AD_CYCLE, str1 = Global.strADPORT }; Global.workThread.BeginStartReadADCycle(msg, _updateADThread); } catch (Exception ex) { MessageBox.Show("异常(Window_Loaded):\n" + ex.Message); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { try { if (!Global.IsTest) { Read.Visibility = Visibility.Hidden; Conclusion.Visibility = Visibility.Hidden; label1.Visibility = Visibility.Hidden; label2.Visibility = Visibility.Hidden; label3.Visibility = Visibility.Hidden; label4.Visibility = Visibility.Hidden; } this.WindowState = System.Windows.WindowState.Normal; this.WindowStyle = System.Windows.WindowStyle.None; this.ResizeMode = System.Windows.ResizeMode.NoResize; this.Left = 0.0; this.Top = 0.0; this.Width = System.Windows.SystemParameters.PrimaryScreenWidth; this.Height = System.Windows.SystemParameters.PrimaryScreenHeight; _list0 = new List <Label>(); _list1 = new List <Label>(); _list2 = new List <Label>(); _list3 = new List <Label>(); _list4 = new List <Label>(); _list5 = new List <Label>(); _list6 = new List <Label>(); _list7 = new List <Label>(); _list8 = new List <Label>(); for (int i = 0; i < Global.deviceHole.HoleCount; ++i) { UIElement element = GenerateChannelADForm(string.Empty + (i + 1)); StackPanelShowAD.Children.Add(element); } _updateADThread = new UpdateADThread(this); _updateADThread.Start(); Message msg = new Message() { what = MsgCode.MSG_READ_AD_CYCLE, str1 = Global.strADPORT }; Global.workThread.BeginStartReadADCycle(msg, _updateADThread); Read.Focus(); } catch (Exception ex) { MessageBox.Show("异常(Window_Loaded):\n" + ex.Message); } }