private void decimalPlacesUpDown_ValueChanged(object sender, EventArgs e) { FormatTypeClass selectedItem = this.formatTypeListBox.SelectedItem as FormatTypeClass; this.sampleLabel.Text = selectedItem.SampleString; this.dirty = true; }
private void dateTimeFormatsListBox_SelectedIndexChanged(object sender, EventArgs e) { FormatTypeClass selectedItem = this.formatTypeListBox.SelectedItem as FormatTypeClass; this.sampleLabel.Text = selectedItem.SampleString; this.dirty = true; }
private void decimalPlacesUpDown_ValueChanged(object sender, EventArgs e) { // update the sample label FormatTypeClass item = formatTypeListBox.SelectedItem as FormatTypeClass; sampleLabel.Text = item.SampleString; Dirty = true; }
private void dateTimeFormatsListBox_SelectedIndexChanged(object sender, System.EventArgs e) { // recompute the SampleLabel FormatTypeClass item = formatTypeListBox.SelectedItem as FormatTypeClass; sampleLabel.Text = item.SampleString; Dirty = true; }
private void formatTypeListBox_SelectedIndexChanged(object sender, EventArgs e) { FormatTypeClass formatType = formatTypeListBox.SelectedItem as FormatTypeClass; UpdateControlVisibility(formatType); sampleLabel.Text = formatType.SampleString; explanationLabel.Text = formatType.TopLabelString; Dirty = true; }
private void formatTypeListBox_SelectedIndexChanged(object sender, EventArgs e) { FormatTypeClass selectedItem = this.formatTypeListBox.SelectedItem as FormatTypeClass; this.UpdateControlVisibility(selectedItem); this.sampleLabel.Text = selectedItem.SampleString; this.explanationLabel.Text = selectedItem.TopLabelString; this.dirty = true; }
private void UpdateControlVisibility(FormatTypeClass formatType) { if (formatType == null) { explanationLabel.Visible = false; sampleLabel.Visible = false; nullValueLabel.Visible = false; secondRowLabel.Visible = false; nullValueTextBox.Visible = false; thirdRowLabel.Visible = false; dateTimeFormatsListBox.Visible = false; customStringTextBox.Visible = false; decimalPlacesUpDown.Visible = false; return; } tableLayoutPanel1.SuspendLayout(); secondRowLabel.Text = ""; // process the decimalPlacesLabelVisible if (formatType.DropDownVisible) { secondRowLabel.Text = SR.BindingFormattingDialogDecimalPlaces; decimalPlacesUpDown.Visible = true; } else { decimalPlacesUpDown.Visible = false; } // process customFormatLabelVisible if (formatType.FormatStringTextBoxVisible) { secondRowLabel.Text = SR.BindingFormattingDialogCustomFormat; thirdRowLabel.Visible = true; tableLayoutPanel1.SetColumn(thirdRowLabel, 0); tableLayoutPanel1.SetColumnSpan(thirdRowLabel, 2); customStringTextBox.Visible = true; if (tableLayoutPanel1.Controls.Contains(dateTimeFormatsListBox)) { tableLayoutPanel1.Controls.Remove(dateTimeFormatsListBox); } tableLayoutPanel1.Controls.Add(customStringTextBox, 1, 1); } else { thirdRowLabel.Visible = false; customStringTextBox.Visible = false; } if (formatType.ListBoxVisible) { secondRowLabel.Text = SR.BindingFormattingDialogType; if (tableLayoutPanel1.Controls.Contains(customStringTextBox)) { tableLayoutPanel1.Controls.Remove(customStringTextBox); } dateTimeFormatsListBox.Visible = true; tableLayoutPanel1.Controls.Add(dateTimeFormatsListBox, 0, 2); tableLayoutPanel1.SetColumn(dateTimeFormatsListBox, 0); tableLayoutPanel1.SetColumnSpan(dateTimeFormatsListBox, 2); } else { dateTimeFormatsListBox.Visible = false; } if (secondRowLabel.Text == "") { secondRowLabel.Visible = false; } else { secondRowLabel.Visible = true; } tableLayoutPanel1.ResumeLayout(true /*performLayout*/); }
private void UpdateControlVisibility(FormatTypeClass formatType) { if (formatType == null) { this.explanationLabel.Visible = false; this.sampleLabel.Visible = false; this.nullValueLabel.Visible = false; this.secondRowLabel.Visible = false; this.nullValueTextBox.Visible = false; this.thirdRowLabel.Visible = false; this.dateTimeFormatsListBox.Visible = false; this.customStringTextBox.Visible = false; this.decimalPlacesUpDown.Visible = false; } else { this.tableLayoutPanel1.SuspendLayout(); this.secondRowLabel.Text = ""; if (formatType.DropDownVisible) { this.secondRowLabel.Text = System.Design.SR.GetString("BindingFormattingDialogDecimalPlaces"); this.decimalPlacesUpDown.Visible = true; } else { this.decimalPlacesUpDown.Visible = false; } if (formatType.FormatStringTextBoxVisible) { this.secondRowLabel.Text = System.Design.SR.GetString("BindingFormattingDialogCustomFormat"); this.thirdRowLabel.Visible = true; this.tableLayoutPanel1.SetColumn(this.thirdRowLabel, 0); this.tableLayoutPanel1.SetColumnSpan(this.thirdRowLabel, 2); this.customStringTextBox.Visible = true; if (this.tableLayoutPanel1.Controls.Contains(this.dateTimeFormatsListBox)) { this.tableLayoutPanel1.Controls.Remove(this.dateTimeFormatsListBox); } this.tableLayoutPanel1.Controls.Add(this.customStringTextBox, 1, 1); } else { this.thirdRowLabel.Visible = false; this.customStringTextBox.Visible = false; } if (formatType.ListBoxVisible) { this.secondRowLabel.Text = System.Design.SR.GetString("BindingFormattingDialogType"); if (this.tableLayoutPanel1.Controls.Contains(this.customStringTextBox)) { this.tableLayoutPanel1.Controls.Remove(this.customStringTextBox); } this.dateTimeFormatsListBox.Visible = true; this.tableLayoutPanel1.Controls.Add(this.dateTimeFormatsListBox, 0, 2); this.tableLayoutPanel1.SetColumn(this.dateTimeFormatsListBox, 0); this.tableLayoutPanel1.SetColumnSpan(this.dateTimeFormatsListBox, 2); } else { this.dateTimeFormatsListBox.Visible = false; } this.tableLayoutPanel1.ResumeLayout(true); } }