private void TextEditKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (sender is TextEdit) { TextEdit edit = sender as TextEdit; FormCtrlInfo ctrl = edit.Tag as FormCtrlInfo; busUDFForm.ClearOutputStr(); if (edit.Text.Trim() != "") { int idxEdit = _edits.IndexOf(edit); busUDFForm.SetStrParameterValue(edit.Text.Trim(), idxEdit + 1); if (IsNoEmptyInput()) { mustAllInputButton.PerformClick(); } else { //SelectNextControl(edit, false, false, false, true); TextEdit nextEdit = GetNextTextEdit(edit); if (nextEdit != null) { nextEdit.Focus(); } } } } } }
private void timerTimeout_Tick(object sender, EventArgs e) { timerTimeout.Stop(); switch (_timeoutResult) { case TimeoutResult.Default: _defaultButtonControl.PerformClick(); break; case TimeoutResult.Cancel: if (_cancelButton != null) { SetResultAndClose(_cancelButton.Value); } else { _defaultButtonControl.PerformClick(); } break; case TimeoutResult.Timeout: SetResultAndClose(MessageBoxExResult.Timeout); break; } }
//Procedimiento utilizado para determinar los documentos a los que tiene acceso el usuario public static void proAccUsuarioDocumento(TextEdit txtCodSerie, TextEdit txtNomSerie, SimpleButton btnCancelar, int varForCodigo, int varOpeCodigo) { //Validamos que documentos tiene acceso el usuario DataTable dtDocumentos = clsSegAccFormulario.funListarDtDocumento(clsVariablesGlobales.varCodUsuario, varForCodigo, varOpeCodigo); //Verificamos si tiene acceso a un solo documento if (dtDocumentos.Rows.Count.Equals(1)) { txtCodSerie.EditValue = int.Parse(dtDocumentos.Rows[0]["DocCodigo"].ToString()); txtNomSerie.Text = dtDocumentos.Rows[0]["DocNombre"].ToString(); }// En caso de que el usuario tenga acceso a mas de un documento le mostraremos un formulario para q escoja el documento else { var frmFormulario = new frmAccDocumento(dtDocumentos) { StartPosition = FormStartPosition.CenterParent }; frmFormulario.ShowDialog(); if (frmFormulario.DrVarFila == null) { btnCancelar.PerformClick(); return; } txtCodSerie.EditValue = int.Parse(((DataRowView)frmFormulario.DrVarFila)["DocCodigo"].ToString()); txtNomSerie.Text = ((DataRowView)frmFormulario.DrVarFila)["DocNombre"].ToString(); } }
private void btnClear_Click(object sender, EventArgs e) { txtKeyboardInput.Text = string.Empty; txtKeyboardInput.Select(); btnSearch.PerformClick(); }
void IButtonControl.PerformClick() { button.PerformClick(); }
private void LoadButtons() { int lastUsedDimensionButtonRow = 1; // Color if (colorButtons == null && viewModel.Exists(DimensionType.Color)) { List <DimensionValue> colors = viewModel.AllVariants.Where(dim => dim.Dimension == DimensionType.Color).ToList(); colors.Sort(DimensionValue.CompareDisplayOrders); colorButtons = new List <Control>(colors.Count); // Colors foreach (var color in colors) { var button = CreateVariantButton(color.Name, color.Id); colorButtons.Add(button); } this.colorButton.Visible = true; // Update the row of the color dimension button so visible buttons will be top stacked this.tableLayoutPanel.SetRow(this.colorButton, lastUsedDimensionButtonRow++); // Add the color variants to the flow panel MakeButtonWidthsUniform(colorButtons); this.flowLayoutPanel.Controls.AddRange(colorButtons.ToArray()); } // Size if (sizeButtons == null && viewModel.Exists(DimensionType.Size)) { List <DimensionValue> sizes = viewModel.AllVariants.Where(dim => dim.Dimension == DimensionType.Size).ToList(); sizes.Sort(DimensionValue.CompareDisplayOrders); sizeButtons = new List <Control>(sizes.Count); // Sizes foreach (var size in sizes) { var button = CreateVariantButton(size.Name, size.Id); sizeButtons.Add(button); } this.sizeButton.Visible = true; // Update the row of the size dimension button so visible buttons will be top stacked this.tableLayoutPanel.SetRow(this.sizeButton, lastUsedDimensionButtonRow++); // Add the size variants to the flow panel MakeButtonWidthsUniform(sizeButtons); this.flowLayoutPanel.Controls.AddRange(sizeButtons.ToArray()); } // Style if (styleButtons == null && viewModel.Exists(DimensionType.Style)) { List <DimensionValue> styles = viewModel.AllVariants.Where(dim => dim.Dimension == DimensionType.Style).ToList(); styles.Sort(DimensionValue.CompareDisplayOrders); styleButtons = new List <Control>(styles.Count); // Styles foreach (var style in styles) { var button = CreateVariantButton(style.Name, style.Id); styleButtons.Add(button); } this.styleButton.Visible = true; // Update the row of the style dimension button so visible buttons will be top stacked this.tableLayoutPanel.SetRow(this.styleButton, lastUsedDimensionButtonRow++); // Add the style variants to the flow panel MakeButtonWidthsUniform(styleButtons); this.flowLayoutPanel.Controls.AddRange(styleButtons.ToArray()); } // Config if (configButtons == null && viewModel.Exists(DimensionType.Config)) { List <DimensionValue> configs = viewModel.AllVariants.Where(dim => dim.Dimension == DimensionType.Config).ToList(); configButtons = new List <Control>(configs.Count); // Configs foreach (var config in configs) { var button = CreateVariantButton(config.Name, config.Id); configButtons.Add(button); } this.configButton.Visible = true; // Update the row of the config dimension button so visible buttons will be top stacked this.tableLayoutPanel.SetRow(this.configButton, lastUsedDimensionButtonRow); // Add the config variants to the flow panel MakeButtonWidthsUniform(configButtons); this.flowLayoutPanel.Controls.AddRange(configButtons.ToArray()); } // Get the button associated with the current dimension SimpleButton dimBtn = GetDimensionButton(viewModel.CurrentDimension); // Update the row for rendering the arrow this.CurrentArrowRow = this.tableLayoutPanel.GetRow(dimBtn); // "Click" the next button to load its variants dimBtn.PerformClick(); }