/// <summary> /// 窗口加载 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void my_Loaded(object sender, RoutedEventArgs e) { // 加入空白行 if (InsertEmpty) { UserInfos emptyInfo = new UserInfos() { UserGuid = string.Empty, UserID = string.Empty, UserName = string.Empty, UserCode = string.Empty }; AppConfigInfos.LimitsUserInfos.Users.UserList.Insert(0, emptyInfo); } // 去掉admin UserInfos adminUser = AppConfigInfos.LimitsUserInfos.Users.UserList.Find(p => p.UserID.ToLower().Equals("admin")); if (adminUser != null) { AppConfigInfos.LimitsUserInfos.Users.UserList.Remove(adminUser); } hintTextBox = cmbMain.Template.FindName("PART_EditableTextBox", cmbMain) as HintTextBox; SetSelectTextByValue(SelectValue); cmbMain.ItemsSource = GetItems(Text); }
/// <summary> /// Creates a new <see cref="AppTile"/> list. /// </summary> public AppTileList() { Size = new Size(425, 200); AutoScaleDimensions = new SizeF(6F, 13F); AutoScaleMode = AutoScaleMode.Font; SuspendLayout(); TextSearch = new HintTextBox { Dock = DockStyle.Top, Height = 20, HintText = Resources.Search, ShowClearButton = true, TabIndex = 0 }; TextSearch.TextChanged += delegate { RefilterTiles(); }; _flowLayout = new FlowLayoutPanel { Location = new Point(0, 0), Size = Size.Empty, Margin = Padding.Empty, FlowDirection = FlowDirection.TopDown }; _scrollPanel = new Panel { Dock = DockStyle.Fill, Margin = Padding.Empty, AutoScroll = true, Controls = { _flowLayout }, TabIndex = 1 }; // Must add scroll panel first for docking to work correctly Controls.Add(_scrollPanel); Controls.Add(TextSearch); Resize += delegate { _flowLayout.SuspendLayout(); _flowLayout.Width = _scrollPanel.Width - (int)(20 * AutoScaleDimensions.Width / 6F); foreach (Control control in _flowLayout.Controls) { control.Width = _flowLayout.Width; } _flowLayout.ResumeLayout(false); }; ResumeLayout(false); }
protected AbstractFormatter(string name, string hint) { LblName = new Label { Text = name }; TbCommand = new HintTextBox { Hint = hint }; CbEnabled = new CheckBox { Text = "" }; CbEnabled.CheckedChanged += (sender, args) => SwitchEnable(); SwitchEnable(); }
protected DownloadRetrievalMethodEditor() { Controls.Add(new Label { Location = new System.Drawing.Point(0, 3), AutoSize = true, TabIndex = 0, Text = "Source URL:" }); var textBoxHref = new UriTextBox { Location = new System.Drawing.Point(77, 0), Size = new System.Drawing.Size(73, 20), Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right, TabIndex = 1, HintText = "HTTP/FTP URL (required)", AllowRelative = true }; textBoxHref.TextChanged += delegate { ShowUpdateHint(Resources.ManifestDigestChanged); }; RegisterControl(textBoxHref, new PropertyPointer <Uri>(() => Target.Href, value => Target.Href = value)); Controls.Add(new Label { Location = new System.Drawing.Point(0, 29), AutoSize = true, TabIndex = 2, Text = "File size:" }); var textBoxSize = new HintTextBox { Location = new System.Drawing.Point(77, 26), Size = new System.Drawing.Size(73, 20), Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right, TabIndex = 3, HintText = "in bytes (required)" }; RegisterControl(textBoxSize, new PropertyPointer <long>(() => Target.Size, value => Target.Size = value).ToStringPointer()); }
protected DownloadRetrievalMethodEditor() { Controls.Add(new Label { Location = new Point(0, 3), AutoSize = true, TabIndex = 0, Text = Resources.SourceUrl + @":" }); var textBoxHref = new UriTextBox { Location = new Point(77, 0), Size = new Size(73, 20), Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right, TabIndex = 1, HintText = Resources.RequiredUrl, AllowRelative = true }; textBoxHref.TextChanged += delegate { ShowUpdateHint(Resources.ManifestDigestChanged); }; Bind(textBoxHref, PropertyPointer.For(() => Target !.Href)); Controls.Add(new Label { Location = new Point(0, 29), AutoSize = true, TabIndex = 2, Text = Resources.FileSize + @":" }); var textBoxSize = new HintTextBox { Location = new Point(77, 26), Size = new Size(73, 20), Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right, TabIndex = 3, HintText = Resources.RequiredBytes }; Bind(textBoxSize, PropertyPointer.For(() => Target !.Size, defaultValue: 0).ToStringPointer()); }
private void MainForm_Load(object sender, EventArgs e) { HintTextBox.SetCueText(InputVideoPath, @"视频路径"); HintTextBox.SetCueText(OutputVideoPath, @"输出路径"); LoadConfig(); if (!Directory.Exists(RecordDirectory.Text)) { RecordDirectory.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyVideos); } timer1.Start(); AutoStartupCheckBox.Checked = AutoStartup.Check(); AutoStartupCheckBox.Click += AutoStartupCheckBox_CheckedChanged; NotifyCheckBox.Click += NotifyCheckBox_Click; radioButton1.CheckedChanged += radioButton_CheckedChanged; radioButton2.CheckedChanged += radioButton_CheckedChanged; radioButton3.CheckedChanged += radioButton_CheckedChanged; radioButton4.CheckedChanged += radioButton_CheckedChanged; RecordDirectory.TextChanged += RecordDirectory_TextChanged; tabControl1.SelectedIndexChanged += tabControl1_SelectedIndexChanged; AutoConvert.CheckedChanged += AutoConvert_CheckedChanged; checkBox1.CheckedChanged += CheckBox1_CheckedChanged; checkBox2.CheckedChanged += CheckBox2_CheckedChanged; checkBox3.CheckedChanged += CheckBox3_CheckedChanged; checkBox4.CheckedChanged += CheckBox4_CheckedChanged; checkBox5.CheckedChanged += CheckBox5_CheckedChanged; checkBox6.CheckedChanged += CheckBox6_CheckedChanged; numericUpDown1.ValueChanged += NumericUpDown1_ValueChanged; numericUpDown2.ValueChanged += NumericUpDown2_ValueChanged; CheckBox1Changed(); CheckBox2Changed(); CheckBox5Changed(); LoadMainList(); }
private void ContentControl_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { HintTextBox.IsEnabled = true; HintTextBox.Focus(); }