public virtual void CheckEditor(TextEdit editor) { if (string.IsNullOrWhiteSpace(editor.Text)) { ErrorProvider.SetError(editor, "Bitte einen Wert angeben", ErrorType.Warning); } }
public static void EditTextErrorMessage(TextEdit textEdit, string title) { textEdit.Properties.Appearance.BorderColor = System.Drawing.Color.Red; MessageBox.Show(string.Format("Error! {0}", title), Resources.MessageBoxErrorMessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); textEdit.Focus(); textEdit.SelectAll(); }
private void ClearControl(TextEdit textEdit) { if ( textEdit.Text == CatalogUsers.EMPTY_PASSWORD && !textEdit.Properties.ReadOnly ) { textEdit.Text = ""; } }
/*Lấy ra dòng dữ liệu và gán vào các hộp text*/ public void SelectCoDK(DChuyenBay DCB, TextEdit txtMaCB, ComboBoxEdit cbMaDB, ComboBoxEdit cbMaMB , TimeEdit dtGioBay, TextEdit txtDiemDi, ComboBoxEdit cbDiemDen , DateTimePicker dtNgayDi, DateTimePicker dtNgayDen, TextEdit txtVeL1, TextEdit txtVeL2, TextEdit txtGhiChu) { try { string path = string.Format("Select * From ChuyenBay Where MaChuyenBay='{0}'", DCB.MCB); DataTable dtt = DA.TbView(path); txtMaCB.EditValue = dtt.Rows[0]["MaChuyenBay"].ToString().Trim(); cbMaDB.EditValue = dtt.Rows[0]["MaDuongBay"].ToString().Trim(); cbMaMB.EditValue = dtt.Rows[0]["MaMayBay"].ToString().Trim(); dtGioBay.Text = dtt.Rows[0]["GioBay"].ToString().Trim(); txtDiemDi.EditValue = dtt.Rows[0]["DiemDi"].ToString().Trim(); cbDiemDen.EditValue = dtt.Rows[0]["DiemDen"].ToString().Trim(); dtNgayDi.Text = dtt.Rows[0]["NgayDi"].ToString().Trim(); dtNgayDen.Text = dtt.Rows[0]["NgayDen"].ToString().Trim(); txtVeL1.EditValue = dtt.Rows[0]["SLV_Loai1"].ToString().Trim(); txtVeL2.EditValue = dtt.Rows[0]["SLV_Loai2"].ToString().Trim(); txtGhiChu.EditValue = dtt.Rows[0]["GhiChu"].ToString().Trim(); //return dt.TbView(path); } catch { XtraMessageBox.Show("Vui lòng kích vào lưới thông tin chọn thông tin cần sửa !", "Chú ý !", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static void SetColorErrorTextControl(TextEdit textEdit, string title) { textEdit.Properties.Appearance.BorderColor = System.Drawing.Color.Red; textEdit.Focus(); textEdit.SelectAll(); MessageBox.Show(title, Resources.MessageBoxErrorMessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); }
public static void TextControlNotNull(TextEdit textEdit, string title) { textEdit.Properties.Appearance.BorderColor = System.Drawing.Color.Red; MessageBox.Show(string.Format("{0} không được để trống!", title), Resources.MessageBoxErrorMessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); textEdit.Focus(); textEdit.SelectAll(); }
/*Lấy ra dòng dữ liệu và gán vào các hộp text*/ public void SelectCoDK(DNhanVien DNV, TextEdit txt1, TextEdit txt2 , TextEdit txt3, TextEdit txt4, ComboBoxEdit cb1 , TextEdit txt5, TextEdit txt6, TextEdit txt7, TextEdit txt8) { try { string path = string.Format("Select * From NhanVien Where MaNhanVien='{0}'", DNV.MaNV); DataTable dtt = DA.TbView(path); txt1.EditValue = dtt.Rows[0]["MaNhanVien"].ToString().Trim(); txt2.EditValue = dtt.Rows[0]["TenNhanVien"].ToString().Trim(); txt3.EditValue = dtt.Rows[0]["DiaChi"].ToString().Trim(); txt4.EditValue = dtt.Rows[0]["SoDienThoai"].ToString().Trim(); cb1.EditValue = dtt.Rows[0]["ChucVu"].ToString().Trim(); txt5.EditValue = dtt.Rows[0]["TenDangNhap"].ToString().Trim(); txt5.EditValue = dtt.Rows[0]["MatKhau"].ToString().Trim(); txt5.EditValue = dtt.Rows[0]["AnhDaiDien"].ToString().Trim(); txt5.EditValue = dtt.Rows[0]["Site"].ToString().Trim(); dtt = null; } catch { XtraMessageBox.Show("Vui lòng kích vào lưới thông tin chọn thông tin cần sửa !", "Chú ý !", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void SetEnableTimeStyle(TextEdit textEdit, bool enableTimeStyle) { if (!list.ContainsKey(textEdit)) { list.Add(textEdit, new TextEdit_TimeStylePara() { EnableTimeStyle = enableTimeStyle }); } else { list[textEdit].EnableTimeStyle = enableTimeStyle; } if (enableTimeStyle) { textEdit.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime; textEdit.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime; textEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.DateTime; string formatstring = list[textEdit].TimeStyleFormatString; if (string.IsNullOrWhiteSpace(formatstring)) { textEdit.Properties.DisplayFormat.FormatString = "yyyy-MM-dd HH:mm:ss"; textEdit.Properties.EditFormat.FormatString = "yyyy-MM-dd HH:mm:ss"; textEdit.Properties.Mask.EditMask = "yyyy-MM-dd HH:mm:ss"; } else { textEdit.Properties.DisplayFormat.FormatString = formatstring; textEdit.Properties.EditFormat.FormatString = formatstring; textEdit.Properties.Mask.EditMask = formatstring; } } }
public string GetTimeStyleFormatString(TextEdit textEdit) { if (list.ContainsKey(textEdit)) { return list[textEdit].TimeStyleFormatString; } return "yyyy-MM-dd HH:mm:ss"; }
public bool GetEnableTimeStyle(TextEdit textEdit) { if (list.ContainsKey(textEdit)) { return list[textEdit].EnableTimeStyle; } return false; }
private static void InitFieldValue(ComboBoxEdit combo, TextEdit text) { combo.Properties.TextEditStyle = TextEditStyles.DisableTextEditor; combo.Properties.Items.Clear(); combo.Properties.Items.Add(FieldType.undefined); combo.Properties.Items.Add(FieldType.uniform); combo.Properties.Items.Add(FieldType.nonuniform); combo.SelectedIndex = 0; }
public static bool ValidationTextEditNullValueMessage(TextEdit textEdit, string messageTitle) { if (string.IsNullOrEmpty(textEdit.Text)) { textEdit.Properties.Appearance.BorderColor = Color.Red; textEdit.Focus(); textEdit.SelectAll(); return false; } return true; }
public static void MakeAutoComplete( TextEdit textEdit, AutoCompleteMode autoCompleteMode, AutoCompleteSource autoCompleteSource) { // http://community.devexpress.com/forums/p/81601/280039.aspx var tx = textEdit.MaskBox; tx.AutoCompleteSource = autoCompleteSource; tx.AutoCompleteMode = autoCompleteMode; }
public static bool IsTextEditEmptyOrSingleZero(TextEdit edit) { if (edit.Text.Equals(String.Empty) | edit.Text.Equals("0")) { return true; } else { return false; } return false; }
public static void FormatTextEdit(TextEdit Input) { if (Input.EditValue!=null && Input.EditValue.ToString()!="" && HelpNumber.ParseDecimal(Input.EditValue) != 0) { Input.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom; Input.Properties.DisplayFormat.FormatString = "{0:#,###}"; Input.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; Input.Properties.Mask.EditMask = "n0"; } }
/*Đẩy dữ liệu vào Vé L1=Số ghế loại 1 và Vé L2=Số ghế loại 2*/ public void LoadLuongVe(TextEdit txtV1, TextEdit txtV2, ComboBoxEdit cbMMB) { DataTable dt = DA.TbView("select SoGheLoai1,SoGheLoai2 from MayBay Where MaMayBay='" + cbMMB.Text + "'"); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { txtV1.Text = dt.Rows[0]["SoGheLoai1"].ToString(); txtV2.Text = dt.Rows[0]["SoGheLoai2"].ToString(); } } }
/*Sinh mã tự động cho code thêm*/ public void SinhMa(TextEdit txt) { DataTable myTB = DA.TbView("select MaMayBay,Site From MayBay"); if (myTB.Rows.Count == 0) { txt.Text = "MMB000"; myTB = null; } /*Sinh mã tự tăng giúp tránh việc mã cung cấp nhập vào bị trùng mã khác*/ if (myTB.Rows.Count > 0) { int temp = Convert.ToInt32(myTB.Rows[myTB.Rows.Count - 1]["MaMayBay"].ToString().Substring(3, 3)) + 1;/*dùng tạm*/ if (temp < 10) { txt.Text = "MMB00" + temp.ToString(); } if (temp >= 10 & temp < 100) { txt.Text = "MMB0" + temp.ToString(); } myTB = null; } myTB = null; }
public BasicInfoRoomType() { InitializeComponent(); ItemTableTemp = new DataTable(); TextEditTrigger = new TextEdit(); TextEditTrigger.EditValue = 0; this.Dock = DockStyle.Fill; this.Load += new EventHandler(BasicInfoRoomType_Load); this.Resize += new EventHandler(BasicInfoRoomType_Resize); TextEditTrigger.TextChanged += new EventHandler(TextEditTrigger_TextChanged); SaveClick += new EventHandler(BasicInfoRoomType_SaveClick); checkEditMonthly.CheckedChanged +=new EventHandler(checkEditMonthly_CheckedChanged); }
private void capturePersonPhone(TextEdit txtPersonPhone, ComboBoxEdit cmbPhoneType, ICollection<PersonPhoneDto> personPhones) { var personPhone = txtPersonPhone.Tag as PersonPhoneDto; if (txtPersonPhone.Text != null) { if (personPhone == null) { personPhone = new PersonPhoneDto(); } personPhone.Phone = txtPersonPhone.Text; var phoneType = cmbPhoneType.SelectedItem as PhoneTypeDto; personPhone.PhoneTypeId = phoneType.Id; personPhones.Add(personPhone); } }
/// <summary> /// Not good reset default /// </summary> /// <param name="textEdit"></param> /// <param name="errorMessage"></param> /// <returns></returns> public static bool ValidationTextEditNullValueWidthErrorProvider(TextEdit textEdit, string errorMessage) { if (string.IsNullOrEmpty(textEdit.Text)) { DXErrorProvider dxErrorProvider = new DXErrorProvider(); textEdit.Properties.Appearance.BorderColor = Color.Red; textEdit.Focus(); dxErrorProvider.SetError(textEdit, errorMessage); return false; } return true; }
public bool Init(Form form, GridFilter gridFilter, TextEdit txtSearchDelay, RadioGroup rgrSearAfter) { _rgrSearAfter = rgrSearAfter; _txtSearchDelay = txtSearchDelay; _GridFilter = gridFilter; // event form.KeyPress += frmSearch_Staff_KeyPress; txtSearchDelay.KeyPress += txtSearchDelay_KeyPress; txtSearchDelay.TextChanged += txtSearchDelay_TextChanged; rgrSearAfter.SelectedIndexChanged += rgrSearAfter_SelectedIndexChanged; // assign form.KeyPreview = true; rgrSearAfter.SelectedIndex = Properties.Settings.Default.rgrSearchAfter; txtSearchDelay.Text = Properties.Settings.Default.searchDelayTime.ToString(); return true; }
/*Lấy ra dòng dữ liệu và gán vào các hộp text*/ public void SelectCoDK(DDuongBay DDB, TextEdit txt1, TextEdit txt2 , TextEdit txt3, TextEdit txt4, ComboBoxEdit cb1) { try { string path = string.Format("Select * From DuongBay Where MaDuongBay='{0}'", DDB.MaDuongBay); DataTable dtt = DA.TbView(path); txt1.EditValue = dtt.Rows[0]["MaDuongBay"].ToString().Trim(); txt2.EditValue = dtt.Rows[0]["ViTri"].ToString().Trim(); txt3.EditValue = dtt.Rows[0]["ChieuDai"].ToString().Trim(); txt4.EditValue = dtt.Rows[0]["ChieuRong"].ToString().Trim(); cb1.EditValue = dtt.Rows[0]["TinhTrang"].ToString().Trim(); dtt = null; } catch { XtraMessageBox.Show("Vui lòng kích vào lưới thông tin chọn thông tin cần sửa !", "Chú ý !", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public RoomList() { InitializeComponent(); // RoommateTableTemp = null; TextEditTrigger = new TextEdit(); TextEditTrigger.EditValue = 0; this.Load += new EventHandler(RoomList_Load); this.gridView1.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(gridView1_FocusedRowChanged); this.bttEdit.Click += new EventHandler(bttEdit_Click); this.bttCancel.Click += new EventHandler(bttCancel_Click); this.bttSave.Click += new EventHandler(bttSave_Click); this.bttAddTenant.Click += new EventHandler(bttAddTenant_Click); this.bttAddExpense.Click += new EventHandler(bttAddExpense_Click); this.bttRemoveTenant.Click += new EventHandler(bttRemoveTenant_Click); TextEditTrigger.TextChanged += new EventHandler(TextEditTrigger_TextChanged); SaveClick += new EventHandler(bttSave_Click); }
private FormTemplatePreview(List<ReportParam> prms) { InitializeComponent(); foreach (ReportParam tp in prms) { BaseEdit ctrl = null; switch (tp.PType) { case ReportParamTypes.TamSayý: SpinEdit se = new SpinEdit(); ctrl = se; break; case ReportParamTypes.Tarih: ctrl = new DateEdit(); break; case ReportParamTypes.Metin: ctrl = new TextEdit(); break; case ReportParamTypes.OndalikliSayi: ctrl = new SpinEdit(); break; case ReportParamTypes.EvetHayir: ctrl = new CheckEdit(); break; case ReportParamTypes.Entity: LookUp lu = new LookUp(); lu.EntityType = DMT.Provider.GetEntityType(tp.PModuleName, tp.PEntityName); lu.DisplayFieldName = tp.PDisplayField; lu.ValueFieldName = tp.PValueField; ctrl = lu; break; default: throw new ArgumentOutOfRangeException(); } ctrl.Name = tp.PName; LayoutControl.AddItem(tp.Name, ctrl); } }
/*Lấy ra dòng dữ liệu và gán vào các hộp text*/ public void SelectCoDK(DMayBay DMB, TextEdit txt1, TextEdit txt2 , TextEdit txt3, TextEdit txt4, TextEdit txt5 , TextEdit txt6, TextEdit txt7) { try { string path = string.Format("Select * From MayBay Where MaMayBay='{0}'", DMB.MaMB); DataTable dtt = DA.TbView(path); txt1.EditValue = dtt.Rows[0]["MaMayBay"].ToString().Trim(); txt2.EditValue = dtt.Rows[0]["TenMayBay"].ToString().Trim(); txt3.EditValue = dtt.Rows[0]["HangSanXuat"].ToString().Trim(); txt4.EditValue = dtt.Rows[0]["KichThuoc"].ToString().Trim(); txt5.EditValue = dtt.Rows[0]["TongGhe"].ToString().Trim(); txt6.EditValue = dtt.Rows[0]["SoGheLoai1"].ToString().Trim(); txt7.EditValue = dtt.Rows[0]["SoGheLoai2"].ToString().Trim(); //return dt.TbView(path); } catch { XtraMessageBox.Show("Vui lòng kích vào lưới thông tin chọn thông tin cần sửa !", "Chú ý !", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void gridView1_ShownEditor(object sender, EventArgs e) { Test.Sale.Database.QuatationData quatation = new Sale.Database.QuatationData(); if (gridView1.FocusedColumn.FieldName.Equals("itemCode"))//Don't work only for this column { TextEdit currentEditor = (sender as GridView).ActiveEditor as TextEdit; if (currentEditor != null) { AutoCompleteStringCollection customSource = new AutoCompleteStringCollection(); quatation.FnConn(); DataTable dt = quatation.FillData("itemcode", ""); string res = quatation.FnTrans(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { customSource.Add(dt.Rows[i][0].ToString()); } } // customSource.Add("Programa 1"); // customSource.Add("Paaaaaaa 3"); //customSource.Add("Pabbbbbb 2"); currentEditor.MaskBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend; currentEditor.MaskBox.AutoCompleteSource = AutoCompleteSource.CustomSource; currentEditor.MaskBox.AutoCompleteCustomSource = customSource; } } else if (gridView1.FocusedColumn.FieldName.Equals("description"))//Don't work only for this column { TextEdit currentEditor = (sender as GridView).ActiveEditor as TextEdit; if (currentEditor != null) { AutoCompleteStringCollection customSource = new AutoCompleteStringCollection(); quatation.FnConn(); DataTable dt = quatation.FillData("name", ""); string res = quatation.FnTrans(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { customSource.Add(dt.Rows[i][0].ToString()); } } currentEditor.MaskBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend; currentEditor.MaskBox.AutoCompleteSource = AutoCompleteSource.CustomSource; currentEditor.MaskBox.AutoCompleteCustomSource = customSource; } } else if (gridView1.FocusedColumn.FieldName.Equals("quantity"))//Don't work only for this column { TextEdit currentEditor = (sender as GridView).ActiveEditor as TextEdit; if (currentEditor != null) { AutoCompleteStringCollection customSource = new AutoCompleteStringCollection(); //quatation.FnConn(); //DataTable dt = quatation.FillData("name", ""); //string res = quatation.FnTrans(); //if (dt.Rows.Count > 0) //{ // for (int i = 0; i < dt.Rows.Count; i++) // { // customSource.Add(dt.Rows[i][0].ToString()); // } //} currentEditor.MaskBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend; currentEditor.MaskBox.AutoCompleteSource = AutoCompleteSource.CustomSource; currentEditor.MaskBox.AutoCompleteCustomSource = customSource; } } }
public override void InitWindow() { //window init SetParameters(nameof(MainWindow), nameof(MainWindow), 1300, 840, false); SetMinSize(500, 300); SetBackground(32, 34, 37); //title title = new TitleBar("Mimic"); title.SetStyle(Styles.GetTitleBarStyle()); HorizontalStack h_stack = new HorizontalStack(); h_stack.SetMargin(0, 22, 0, 0); h_stack.SetSpacing(0, 0); //left block VerticalStack left = new VerticalStack();//70 left.SetWidth(70); left.SetWidthPolicy(SizePolicy.Fixed); left.SetPadding(2, 0, 2, 2); left.SetSpacing(0, 10); SpaceVIL.Rectangle line = new SpaceVIL.Rectangle(); line.SetBackground(32, 34, 37); line.SetSizePolicy(SizePolicy.Expand, SizePolicy.Fixed); line.SetHeight(1); line.SetShadow(2, 0, 2, Color.FromArgb(150, 0, 0, 0)); line.SetMargin(8, 0, 8, 0); ButtonCore mimic_icon = new ButtonCore("M"); mimic_icon.SetFont(new Font(DefaultsService.GetDefaultFont().FontFamily, 30, FontStyle.Bold)); mimic_icon.SetSize(50, 50); mimic_icon.SetBackground(114, 137, 208); mimic_icon.SetAlignment(ItemAlignment.Top | ItemAlignment.HCenter); mimic_icon.SetBorderRadius(new CornerRadius(15)); SpaceVIL.Rectangle divider = new SpaceVIL.Rectangle(); divider.SetBackground(47, 49, 54); divider.SetSizePolicy(SizePolicy.Expand, SizePolicy.Fixed); divider.SetHeight(2); divider.SetMargin(15, 0, 15, 0); ButtonToggle notes_area_btn = new ButtonToggle("N"); notes_area_btn.SetFont(new Font(DefaultsService.GetDefaultFont().FontFamily, 30, FontStyle.Bold)); notes_area_btn.SetSize(50, 50); notes_area_btn.SetBackground(Color.Transparent); notes_area_btn.SetForeground(100, 101, 105); notes_area_btn.SetAlignment(ItemAlignment.Top | ItemAlignment.HCenter); notes_area_btn.SetBorderRadius(new CornerRadius(15)); notes_area_btn.SetBorderFill(100, 101, 105); notes_area_btn.SetBorderThickness(1); notes_area_btn.EventMouseClick += (sender, args) => { if (notes_area_btn.IsToggled()) { freeNotes.SetVisible(true); conversation.SetVisible(false); freeNotes.GetParent().Update(GeometryEventType.ResizeHeight); } else { freeNotes.SetVisible(false); conversation.SetVisible(true); freeNotes.GetParent().Update(GeometryEventType.ResizeHeight); } }; ButtonCore add_btn = new ButtonCore(); add_btn.SetSize(50, 50); add_btn.SetBackground(Color.Transparent); add_btn.SetAlignment(ItemAlignment.Top | ItemAlignment.HCenter); add_btn.SetBorderRadius(new CornerRadius(25)); add_btn.SetBorderFill(100, 101, 105); add_btn.SetBorderThickness(1); add_btn.SetToolTip("Add a new friend."); add_btn.EventMouseClick += (sender, args) => { AddMenuDialog dialog = new AddMenuDialog(); dialog.OnCloseDialog += () => { string result = dialog.InputResult; if (!result.Equals(String.Empty)) { contacts_bar.AddItem(InfinityItemsBox.GetVisualContact(result, input_message)); } }; dialog.Show(this); }; CustomShape plus = new CustomShape(); plus.SetBackground(100, 101, 105); plus.SetSize(20, 20); plus.SetAlignment(ItemAlignment.VCenter | ItemAlignment.HCenter); plus.SetTriangles(GraphicsMathService.GetCross(20, 20, 2, 0)); //middleblock VerticalStack middle = new VerticalStack();//240 middle.SetStyle(Styles.GetCommonContainerStyle()); middle.SetWidth(240); middle.SetWidthPolicy(SizePolicy.Fixed); middle.SetBackground(47, 49, 54); middle.SetBorderRadius(new CornerRadius(6, 0, 6, 0)); Frame search_bar = new Frame(); search_bar.SetBorderRadius(new CornerRadius(6, 0, 0, 0)); search_bar.SetBackground(47, 49, 54); search_bar.SetHeight(48); search_bar.SetPadding(15, 0, 15, 0); search_bar.SetHeightPolicy(SizePolicy.Fixed); search_bar.SetShadow(2, 0, 2, Color.FromArgb(150, 0, 0, 0)); contacts_bar = new ListBox(); contacts_bar.SetPadding(8, 8, 8, 8); contacts_bar.SetBackground(Color.Transparent); contacts_bar.SetHScrollBarVisible(ScrollBarVisibility.Never); contacts_bar.SetVScrollBarVisible(ScrollBarVisibility.Never); contacts_bar.SetSelectionVisible(false); Frame user_bar = new Frame(); user_bar.SetBorderRadius(new CornerRadius(0, 0, 6, 0)); user_bar.SetBackground(42, 44, 49); user_bar.SetHeight(48); user_bar.SetPadding(15, 0, 15, 0); user_bar.SetHeightPolicy(SizePolicy.Fixed); user_bar.SetAlignment(ItemAlignment.Bottom); TextEdit search = new TextEdit(); search.SetPadding(10, 0, 10, 0); search.SetFont(DefaultsService.GetDefaultFont(12)); search.SetForeground(150, 150, 150); search.SetSubstrateText("Find or start conversation"); search.SetSubstrateFontSize(12); search.SetSubstrateFontStyle(FontStyle.Regular); search.SetSubstrateForeground(100, 100, 100); search.SetHeight(32); search.SetBackground(37, 39, 43); search.SetAlignment(ItemAlignment.HCenter, ItemAlignment.VCenter); search.SetBorderRadius(4); search.SetBorderThickness(1); search.SetBorderFill(32, 34, 37); //right block VerticalStack right = new VerticalStack();//expand right.SetStyle(Styles.GetCommonContainerStyle()); right.SetSpacing(0, 2); HorizontalStack conversation_bar = new HorizontalStack(); conversation_bar.SetBackground(54, 57, 63); conversation_bar.SetHeight(48); conversation_bar.SetHeightPolicy(SizePolicy.Fixed); conversation_bar.SetPadding(10, 0, 0, 0); conversation_bar.SetSpacing(5, 0); conversation_bar.SetShadow(2, 0, 2, Color.FromArgb(150, 0, 0, 0)); freeNotes = new FreeArea(); freeNotes.SetVisible(false); freeNotes.SetBackground(Color.FromArgb(5, 255, 255, 255)); conversation = new ListBox(); conversation.SetPadding(4, 4, 4, 4); conversation.SetBackground(Color.Transparent); conversation.SetHScrollBarVisible(ScrollBarVisibility.Never); conversation.GetArea().SetPadding(16, 10, 2, 2); conversation.SetSelectionVisible(false); VerticalScrollBar vs = conversation.VScrollBar; vs.SetWidth(16); vs.SetBorderThickness(4); vs.SetBorderFill(54, 57, 63); vs.SetBorderRadius(new CornerRadius(9)); vs.SetArrowsVisible(false); vs.SetBackground(47, 49, 54); vs.SetPadding(0, 0, 0, 0); vs.Slider.Track.SetBackground(Color.Transparent); vs.Slider.SetBorderThickness(4); vs.Slider.SetBorderFill(54, 57, 63); vs.Slider.SetBorderRadius(new CornerRadius(9)); vs.Slider.SetBackground(32, 34, 37, 255); vs.Slider.SetMargin(new Indents(0, 0, 0, 0)); vs.Slider.RemoveAllItemStates(); HorizontalStack input_bar = new HorizontalStack(); input_bar.SetHeight(44); input_bar.SetHeightPolicy(SizePolicy.Fixed); input_bar.SetMargin(20, 10, 20, 30); input_bar.SetPadding(15, 0, 8, 0); input_bar.SetSpacing(10, 0); input_bar.SetBackground(72, 75, 81); input_bar.SetBorderRadius(new CornerRadius(6, 6, 6, 6)); ButtonCore emoji = new ButtonCore("+"); emoji.SetSize(24, 24); emoji.SetBackground(126, 128, 132); emoji.SetAlignment(ItemAlignment.VCenter | ItemAlignment.Left); emoji.SetBorderRadius(new CornerRadius(12)); SpaceVIL.Rectangle divider_v = new SpaceVIL.Rectangle(); divider_v.SetBackground(126, 128, 132); divider_v.SetWidth(2); divider_v.SetSizePolicy(SizePolicy.Fixed, SizePolicy.Expand); divider_v.SetMargin(0, 10, 0, 10); input_message = new TextEdit(); input_message.SetBackground(Color.Transparent); input_message.SetForeground(Color.White); input_message.SetAlignment(ItemAlignment.VCenter); input_message.SetBorderRadius(new CornerRadius(0, 3, 0, 3)); input_message.SetSubstrateText("Message @Jackson"); input_message.EventKeyPress += (sender, args) => { if (args.Key == KeyCode.Enter) { conversation.AddItem(InfinityItemsBox.GetMessage(input_message.GetText())); input_message.Clear(); } }; ButtonCore add_note = InfinityItemsBox.GetOrdinaryButton(); add_note.SetForeground(166, 167, 168); add_note.SetFont(new Font(DefaultsService.GetDefaultFont().FontFamily, 12, FontStyle.Bold)); add_note.SetText("Add new note"); add_note.SetWidth(100); add_note.SetShadow(4, 0, 2, Color.FromArgb(150, 0, 0, 0)); add_note.EventMouseClick += (sender, args) => { NoteBlock block = InfinityItemsBox.GetNoteBlock(); block.SetPosition(100, 100); freeNotes.AddItem(block); }; //adding items AddItems( title, h_stack ); h_stack.AddItems( left, middle, right ); left.AddItems( line, mimic_icon, divider, notes_area_btn, add_btn ); add_btn.AddItem( plus ); middle.AddItems( search_bar, contacts_bar, user_bar ); search_bar.AddItems( search ); user_bar.AddItems( new UserBar("Daniel") ); right.AddItems( conversation_bar, conversation, freeNotes, input_bar ); conversation_bar.AddItems( add_note, InfinityItemsBox.GetOrdinaryButton(), InfinityItemsBox.GetOrdinaryButton(), InfinityItemsBox.GetOrdinaryButton(), InfinityItemsBox.GetOrdinaryButton() ); input_bar.AddItems( emoji, divider_v, input_message ); contacts_bar.AddItems( InfinityItemsBox.GetVisualContact("Jackson", input_message), InfinityItemsBox.GetVisualContact("Evelyn", input_message), InfinityItemsBox.GetVisualContact("Alexander", input_message), InfinityItemsBox.GetVisualContact("Matthew", input_message) ); }
/// <summary> /// 自定义扩展列 /// </summary> private void extendPropertyGen() { // 自动加载扩展的列 try { document doc = new document(); doc.document_type_id = docType.id; doc.document_type_name = docType.name; document_type doctype = WcfServiceLocator.Create <IDocPropertyBuild>().getDocumentProperty(doc); docPropertyList = doctype.DocProperty; int Location_y = 10; int actlocation = 0; for (int i = 0; i < docPropertyList.Count; i++) { doc_attached_property docp = docPropertyList[i]; if (!docp.is_display) { continue; } if (actlocation % 2 == 0) { // 为第一列 LabelControl lbk1 = new LabelControl(); lbk1.Name = "lbk1" + i; lbk1.Text = docp.cn_name + ":"; lbk1.Size = new System.Drawing.Size(60, 15); lbk1.Location = new System.Drawing.Point(25, Location_y); this.xtraTabPage2.Controls.Add(lbk1); if (docp.input_type == "SEL") { ComboBoxEdit cbx1 = new ComboBoxEdit(); // 添加下拉框的值 foreach (doc_combobox_value boxvalue in docp.ComboxValue) { cbx1.Properties.Items.Add(boxvalue.value); } cbx1.Name = docp.en_name; cbx1.Size = new System.Drawing.Size(280, 20); cbx1.Location = new System.Drawing.Point(108, Location_y - 4); this.xtraTabPage2.Controls.Add(cbx1); } else { TextEdit txtk1 = new TextEdit(); txtk1.Name = docp.en_name; txtk1.Size = new System.Drawing.Size(280, 20); txtk1.Location = new System.Drawing.Point(108, Location_y - 4); this.xtraTabPage2.Controls.Add(txtk1); } } else { // 为第二列 LabelControl lbk2 = new LabelControl(); lbk2.Name = "lbk2" + i; lbk2.Text = docp.cn_name + ":"; lbk2.Size = new System.Drawing.Size(60, 15); lbk2.Location = new System.Drawing.Point(412, Location_y); this.xtraTabPage2.Controls.Add(lbk2); if (docp.input_type == "SEL") { ComboBoxEdit cbx1 = new ComboBoxEdit(); // 添加下拉框的值 foreach (doc_combobox_value boxvalue in docp.ComboxValue) { cbx1.Properties.Items.Add(boxvalue.value); } cbx1.Name = docp.en_name; cbx1.Size = new System.Drawing.Size(280, 20); cbx1.Location = new System.Drawing.Point(108, Location_y - 4); this.xtraTabPage2.Controls.Add(cbx1); } else { TextEdit txtk2 = new TextEdit(); txtk2.Name = docp.en_name; txtk2.Size = new System.Drawing.Size(264, 20); txtk2.Location = new System.Drawing.Point(500, Location_y - 4); this.xtraTabPage2.Controls.Add(txtk2); } Location_y = Location_y + 30; } actlocation++; } } catch (Exception ex) { Console.WriteLine(ex.Message); } }
// 显示油耗参数窗口 public void getParamList(string strType) { // 先清空,再添加 this.tlp.Controls.Clear(); this.tlp.Location = new Point(10, 30); string sql = "SELECT PARAM_CODE, PARAM_NAME, FUEL_TYPE, PARAM_REMARK,CONTROL_TYPE,CONTROL_VALUE FROM RLLX_PARAM WHERE (FUEL_TYPE = '" + strType + "' AND STATUS = '1') ORDER BY ORDER_RULE"; DataSet ds = AccessHelper.ExecuteDataSet(AccessHelper.conn, sql, null); DataTable dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { // textbox类型 if (dr["CONTROL_TYPE"].ToString() == "TEXT") { Label lbl = new Label(); lbl.Width = 160; lbl.Height = 30; lbl.Name = "lbl" + dr["PARAM_CODE"].ToString(); lbl.Text = dr["PARAM_NAME"].ToString(); lbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; TextEdit tb = new TextEdit(); tb.Width = 250; tb.Height = 28; tb.Name = dr["PARAM_CODE"].ToString(); Label lbll = new Label(); lbll.Width = 100; lbll.Height = 30; lbll.Text = dr["PARAM_REMARK"].ToString(); lbll.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.tlp.Controls.Add(lbl); this.tlp.Controls.Add(tb); this.tlp.Controls.Add(lbll); } // OPTION类型 if (dr["CONTROL_TYPE"].ToString() == "OPTION") { Label lbl = new Label(); lbl.Width = 160; lbl.Height = 30; lbl.Name = "lbl" + dr["PARAM_CODE"].ToString(); lbl.Text = dr["PARAM_NAME"].ToString(); lbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; DevExpress.XtraEditors.ComboBoxEdit cbe = new ComboBoxEdit(); cbe.Width = 250; cbe.Height = 28; cbe.Name = dr["PARAM_CODE"].ToString(); cbe.Properties.Items.AddRange(getArray(dr["CONTROL_VALUE"].ToString())); cbe.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; Label lbll = new Label(); lbll.Width = 100; lbll.Height = 30; lbll.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.tlp.Controls.Add(lbl); this.tlp.Controls.Add(cbe); this.tlp.Controls.Add(lbll); } tlp.Location = new Point(0, 15); } }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmPropertyQuery)); this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); this.btnUnSelectAll = new DevExpress.XtraEditors.SimpleButton(); this.btnSelectAll = new DevExpress.XtraEditors.SimpleButton(); this.treelist = new DevExpress.XtraTreeList.TreeList(); this.NodeName = new DevExpress.XtraTreeList.Columns.TreeListColumn(); this.NodeObject = new DevExpress.XtraTreeList.Columns.TreeListColumn(); this.imageCollection1 = new DevExpress.Utils.ImageCollection(this.components); this.labelControl1 = new DevExpress.XtraEditors.LabelControl(); this.listBoxControlValues = new DevExpress.XtraEditors.ListBoxControl(); this.teValue = new DevExpress.XtraEditors.TextEdit(); this.btnCancel = new DevExpress.XtraEditors.SimpleButton(); this.btnQuery = new DevExpress.XtraEditors.SimpleButton(); this.panelControl1 = new DevExpress.XtraEditors.PanelControl(); this.labelControl3 = new DevExpress.XtraEditors.LabelControl(); this.labelControl2 = new DevExpress.XtraEditors.LabelControl(); this.pictureEdit1 = new DevExpress.XtraEditors.PictureEdit(); this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup(); this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlGroup2 = new DevExpress.XtraLayout.LayoutControlGroup(); this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem9 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlGroup3 = new DevExpress.XtraLayout.LayoutControlGroup(); this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem(); this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit(); this.layoutControl1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.treelist)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.imageCollection1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.listBoxControlValues)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.teValue.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit(); this.panelControl1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureEdit1.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit(); this.SuspendLayout(); // // layoutControl1 // this.layoutControl1.Controls.Add(this.btnUnSelectAll); this.layoutControl1.Controls.Add(this.btnSelectAll); this.layoutControl1.Controls.Add(this.treelist); this.layoutControl1.Controls.Add(this.labelControl1); this.layoutControl1.Controls.Add(this.listBoxControlValues); this.layoutControl1.Controls.Add(this.teValue); this.layoutControl1.Controls.Add(this.btnCancel); this.layoutControl1.Controls.Add(this.btnQuery); this.layoutControl1.Controls.Add(this.panelControl1); this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.layoutControl1.Location = new System.Drawing.Point(0, 0); this.layoutControl1.Name = "layoutControl1"; this.layoutControl1.Root = this.layoutControlGroup1; this.layoutControl1.Size = new System.Drawing.Size(419, 417); this.layoutControl1.TabIndex = 0; this.layoutControl1.Text = "layoutControl1"; // // btnUnSelectAll // this.btnUnSelectAll.Location = new System.Drawing.Point(98, 364); this.btnUnSelectAll.Name = "btnUnSelectAll"; this.btnUnSelectAll.Size = new System.Drawing.Size(90, 22); this.btnUnSelectAll.StyleController = this.layoutControl1; this.btnUnSelectAll.TabIndex = 2; this.btnUnSelectAll.Text = "全不选"; this.btnUnSelectAll.Click += new System.EventHandler(this.btnUnSelectAll_Click); // // btnSelectAll // this.btnSelectAll.Location = new System.Drawing.Point(5, 364); this.btnSelectAll.Name = "btnSelectAll"; this.btnSelectAll.Size = new System.Drawing.Size(89, 22); this.btnSelectAll.StyleController = this.layoutControl1; this.btnSelectAll.TabIndex = 1; this.btnSelectAll.Text = "全选"; this.btnSelectAll.Click += new System.EventHandler(this.btnSelectAll_Click); // // treelist // this.treelist.Appearance.FocusedCell.BackColor = System.Drawing.Color.CornflowerBlue; this.treelist.Appearance.FocusedCell.Options.UseBackColor = true; this.treelist.Columns.AddRange(new DevExpress.XtraTreeList.Columns.TreeListColumn[] { this.NodeName, this.NodeObject }); this.treelist.Location = new System.Drawing.Point(5, 93); this.treelist.Name = "treelist"; this.treelist.OptionsBehavior.AllowRecursiveNodeChecking = true; this.treelist.OptionsView.ShowCheckBoxes = true; this.treelist.OptionsView.ShowColumns = false; this.treelist.OptionsView.ShowIndicator = false; this.treelist.OptionsView.ShowVertLines = false; this.treelist.Size = new System.Drawing.Size(183, 267); this.treelist.StateImageList = this.imageCollection1; this.treelist.TabIndex = 0; this.treelist.AfterCheckNode += new DevExpress.XtraTreeList.NodeEventHandler(this.treelist_AfterCheckNode); // // NodeName // this.NodeName.Caption = "名称"; this.NodeName.FieldName = "NodeName"; this.NodeName.MinWidth = 49; this.NodeName.Name = "NodeName"; this.NodeName.OptionsColumn.AllowEdit = false; this.NodeName.UnboundType = DevExpress.XtraTreeList.Data.UnboundColumnType.String; this.NodeName.Visible = true; this.NodeName.VisibleIndex = 0; // // NodeObject // this.NodeObject.Caption = "对象"; this.NodeObject.FieldName = "NodeObject"; this.NodeObject.Name = "NodeObject"; this.NodeObject.UnboundType = DevExpress.XtraTreeList.Data.UnboundColumnType.Object; // // imageCollection1 // this.imageCollection1.ImageStream = ((DevExpress.Utils.ImageCollectionStreamer)(resources.GetObject("imageCollection1.ImageStream"))); this.imageCollection1.Images.SetKeyName(0, "Group.png"); this.imageCollection1.Images.SetKeyName(1, "FeatureLayer_model.png"); // // labelControl1 // this.labelControl1.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None; this.labelControl1.Location = new System.Drawing.Point(198, 93); this.labelControl1.Name = "labelControl1"; this.labelControl1.Size = new System.Drawing.Size(216, 14); this.labelControl1.StyleController = this.layoutControl1; this.labelControl1.TabIndex = 10; this.labelControl1.Text = "选择或者输入属性值"; // // listBoxControlValues // this.listBoxControlValues.Location = new System.Drawing.Point(198, 137); this.listBoxControlValues.Name = "listBoxControlValues"; this.listBoxControlValues.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; this.listBoxControlValues.Size = new System.Drawing.Size(216, 249); this.listBoxControlValues.StyleController = this.layoutControl1; this.listBoxControlValues.TabIndex = 4; this.listBoxControlValues.SelectedIndexChanged += new System.EventHandler(this.listBoxControlValues_SelectedIndexChanged); // // teValue // this.teValue.Location = new System.Drawing.Point(198, 111); this.teValue.Name = "teValue"; this.teValue.Size = new System.Drawing.Size(216, 22); this.teValue.StyleController = this.layoutControl1; this.teValue.TabIndex = 3; // // btnCancel // this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnCancel.Location = new System.Drawing.Point(308, 393); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(109, 22); this.btnCancel.StyleController = this.layoutControl1; this.btnCancel.TabIndex = 6; this.btnCancel.Text = "取消"; this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); // // btnQuery // this.btnQuery.Location = new System.Drawing.Point(195, 393); this.btnQuery.Name = "btnQuery"; this.btnQuery.Size = new System.Drawing.Size(109, 22); this.btnQuery.StyleController = this.layoutControl1; this.btnQuery.TabIndex = 5; this.btnQuery.Text = "查询"; this.btnQuery.Click += new System.EventHandler(this.btnQuery_Click); // // panelControl1 // this.panelControl1.Controls.Add(this.labelControl3); this.panelControl1.Controls.Add(this.labelControl2); this.panelControl1.Controls.Add(this.pictureEdit1); this.panelControl1.Location = new System.Drawing.Point(2, 2); this.panelControl1.Name = "panelControl1"; this.panelControl1.Size = new System.Drawing.Size(415, 64); this.panelControl1.TabIndex = 5; // // labelControl3 // this.labelControl3.Location = new System.Drawing.Point(215, 34); this.labelControl3.Name = "labelControl3"; this.labelControl3.Size = new System.Drawing.Size(70, 14); this.labelControl3.TabIndex = 2; this.labelControl3.Text = "labelControl3"; // // labelControl2 // this.labelControl2.Appearance.Font = new System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Bold); this.labelControl2.Location = new System.Drawing.Point(183, 10); this.labelControl2.Name = "labelControl2"; this.labelControl2.Size = new System.Drawing.Size(60, 17); this.labelControl2.TabIndex = 1; this.labelControl2.Text = "属性查询"; // // pictureEdit1 // this.pictureEdit1.EditValue = ((object)(resources.GetObject("pictureEdit1.EditValue"))); this.pictureEdit1.Location = new System.Drawing.Point(104, 5); this.pictureEdit1.Name = "pictureEdit1"; this.pictureEdit1.Size = new System.Drawing.Size(48, 48); this.pictureEdit1.TabIndex = 0; // // layoutControlGroup1 // this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1"; this.layoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; this.layoutControlGroup1.GroupBordersVisible = false; this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { this.layoutControlItem2, this.layoutControlGroup2, this.layoutControlGroup3, this.emptySpaceItem1, this.layoutControlItem4, this.layoutControlItem3 }); this.layoutControlGroup1.Location = new System.Drawing.Point(0, 0); this.layoutControlGroup1.Name = "layoutControlGroup1"; this.layoutControlGroup1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); this.layoutControlGroup1.Size = new System.Drawing.Size(419, 417); this.layoutControlGroup1.Text = "layoutControlGroup1"; this.layoutControlGroup1.TextVisible = false; // // layoutControlItem2 // this.layoutControlItem2.Control = this.panelControl1; this.layoutControlItem2.CustomizationFormText = "layoutControlItem2"; this.layoutControlItem2.Location = new System.Drawing.Point(0, 0); this.layoutControlItem2.Name = "layoutControlItem2"; this.layoutControlItem2.Size = new System.Drawing.Size(419, 68); this.layoutControlItem2.Text = "layoutControlItem2"; this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem2.TextToControlDistance = 0; this.layoutControlItem2.TextVisible = false; // // layoutControlGroup2 // this.layoutControlGroup2.CustomizationFormText = "图层树"; this.layoutControlGroup2.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { this.layoutControlItem1, this.layoutControlItem8, this.layoutControlItem9 }); this.layoutControlGroup2.Location = new System.Drawing.Point(0, 68); this.layoutControlGroup2.Name = "layoutControlGroup2"; this.layoutControlGroup2.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); this.layoutControlGroup2.Size = new System.Drawing.Size(193, 323); this.layoutControlGroup2.Text = "图层树"; // // layoutControlItem1 // this.layoutControlItem1.Control = this.treelist; this.layoutControlItem1.CustomizationFormText = "layoutControlItem1"; this.layoutControlItem1.Location = new System.Drawing.Point(0, 0); this.layoutControlItem1.Name = "layoutControlItem1"; this.layoutControlItem1.Size = new System.Drawing.Size(187, 271); this.layoutControlItem1.Text = "layoutControlItem1"; this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem1.TextToControlDistance = 0; this.layoutControlItem1.TextVisible = false; // // layoutControlItem8 // this.layoutControlItem8.Control = this.btnSelectAll; this.layoutControlItem8.CustomizationFormText = "layoutControlItem8"; this.layoutControlItem8.Location = new System.Drawing.Point(0, 271); this.layoutControlItem8.Name = "layoutControlItem8"; this.layoutControlItem8.Size = new System.Drawing.Size(93, 26); this.layoutControlItem8.Text = "layoutControlItem8"; this.layoutControlItem8.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem8.TextToControlDistance = 0; this.layoutControlItem8.TextVisible = false; // // layoutControlItem9 // this.layoutControlItem9.Control = this.btnUnSelectAll; this.layoutControlItem9.CustomizationFormText = "layoutControlItem9"; this.layoutControlItem9.Location = new System.Drawing.Point(93, 271); this.layoutControlItem9.Name = "layoutControlItem9"; this.layoutControlItem9.Size = new System.Drawing.Size(94, 26); this.layoutControlItem9.Text = "layoutControlItem9"; this.layoutControlItem9.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem9.TextToControlDistance = 0; this.layoutControlItem9.TextVisible = false; // // layoutControlGroup3 // this.layoutControlGroup3.CustomizationFormText = "查询条件"; this.layoutControlGroup3.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { this.layoutControlItem7, this.layoutControlItem5, this.layoutControlItem6 }); this.layoutControlGroup3.Location = new System.Drawing.Point(193, 68); this.layoutControlGroup3.Name = "layoutControlGroup3"; this.layoutControlGroup3.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); this.layoutControlGroup3.Size = new System.Drawing.Size(226, 323); this.layoutControlGroup3.Text = "查询条件"; // // layoutControlItem7 // this.layoutControlItem7.Control = this.labelControl1; this.layoutControlItem7.CustomizationFormText = "layoutControlItem7"; this.layoutControlItem7.Location = new System.Drawing.Point(0, 0); this.layoutControlItem7.Name = "layoutControlItem7"; this.layoutControlItem7.Size = new System.Drawing.Size(220, 18); this.layoutControlItem7.Text = "layoutControlItem7"; this.layoutControlItem7.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem7.TextToControlDistance = 0; this.layoutControlItem7.TextVisible = false; // // layoutControlItem5 // this.layoutControlItem5.Control = this.teValue; this.layoutControlItem5.CustomizationFormText = "layoutControlItem5"; this.layoutControlItem5.Location = new System.Drawing.Point(0, 18); this.layoutControlItem5.Name = "layoutControlItem5"; this.layoutControlItem5.Size = new System.Drawing.Size(220, 26); this.layoutControlItem5.Text = "layoutControlItem5"; this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem5.TextToControlDistance = 0; this.layoutControlItem5.TextVisible = false; // // layoutControlItem6 // this.layoutControlItem6.Control = this.listBoxControlValues; this.layoutControlItem6.CustomizationFormText = "layoutControlItem6"; this.layoutControlItem6.Location = new System.Drawing.Point(0, 44); this.layoutControlItem6.Name = "layoutControlItem6"; this.layoutControlItem6.Size = new System.Drawing.Size(220, 253); this.layoutControlItem6.Text = "layoutControlItem6"; this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem6.TextToControlDistance = 0; this.layoutControlItem6.TextVisible = false; // // emptySpaceItem1 // this.emptySpaceItem1.AllowHotTrack = false; this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1"; this.emptySpaceItem1.Location = new System.Drawing.Point(0, 391); this.emptySpaceItem1.Name = "emptySpaceItem1"; this.emptySpaceItem1.Size = new System.Drawing.Size(193, 26); this.emptySpaceItem1.Text = "emptySpaceItem1"; this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0); // // layoutControlItem4 // this.layoutControlItem4.Control = this.btnCancel; this.layoutControlItem4.CustomizationFormText = "layoutControlItem4"; this.layoutControlItem4.Location = new System.Drawing.Point(306, 391); this.layoutControlItem4.Name = "layoutControlItem4"; this.layoutControlItem4.Size = new System.Drawing.Size(113, 26); this.layoutControlItem4.Text = "layoutControlItem4"; this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem4.TextToControlDistance = 0; this.layoutControlItem4.TextVisible = false; // // layoutControlItem3 // this.layoutControlItem3.Control = this.btnQuery; this.layoutControlItem3.CustomizationFormText = "layoutControlItem3"; this.layoutControlItem3.Location = new System.Drawing.Point(193, 391); this.layoutControlItem3.Name = "layoutControlItem3"; this.layoutControlItem3.Size = new System.Drawing.Size(113, 26); this.layoutControlItem3.Text = "layoutControlItem3"; this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem3.TextToControlDistance = 0; this.layoutControlItem3.TextVisible = false; // // FrmPropertyQuery // this.CancelButton = this.btnCancel; this.ClientSize = new System.Drawing.Size(419, 417); this.Controls.Add(this.layoutControl1); this.MinimizeBox = false; this.Name = "FrmPropertyQuery"; this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Load += new System.EventHandler(this.FrmPropertyQuery_Load); ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit(); this.layoutControl1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.treelist)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.imageCollection1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.listBoxControlValues)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.teValue.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).EndInit(); this.panelControl1.ResumeLayout(false); this.panelControl1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureEdit1.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit(); this.ResumeLayout(false); }
public ArrayList ListaValores(Int32 inrLista, String idsWhere, Boolean multiselecao, String idsnovocabecalho = "") { MultiSelecao = multiselecao; frmLista = new DevExpress.XtraEditors.XtraForm(); Int32 iHeight = 0; Int32 iWidth = 0; String isqlConsulta = ""; try { tbDadosLista = new DataTable("dadosLista"); if (Conexao.getInstance().getConnection().State == ConnectionState.Open) { Object[] consulta = Utilidades.consultar(String.Format(" select ds_titulo,nr_altura,nr_largura,ds_instrucaosql from listavalores where nr_sequencial = {0}", inrLista)); if (consulta != null) { if (Convert.ToInt32(consulta[1]) > 0) { iHeight = Convert.ToInt32(consulta[1]); } if (Convert.ToInt32(consulta[2]) > 0) { iWidth = Convert.ToInt32(consulta[2]); } // se foi passado um novo cabeçalho, usa o que o usuário passou if (idsnovocabecalho.Trim().Length > 0) { frmLista.Text = idsnovocabecalho; } else { frmLista.Text = String.Format("({0}) - {1}", inrLista, Convert.ToString(consulta[0])); } isqlConsulta = Convert.ToString(consulta[3]); } if (!isqlConsulta.Equals("")) { isqlConsulta = isqlConsulta.Replace(":pDsWhere", idsWhere); NpgsqlCommand cmd = new NpgsqlCommand(isqlConsulta, Conexao.getInstance().getConnection()); NpgsqlDataAdapter adapter = new NpgsqlDataAdapter(cmd); adapter.Fill(tbDadosLista); if (multiselecao) { tbDadosLista.Columns.Add("X", typeof(String)).SetOrdinal(0); } } } objRetorno = new ArrayList(); frmLista.ClientSize = new Size(iWidth, iHeight + 10); frmLista.Font = new Font("Tahoma", 9, FontStyle.Bold); frmLista.WindowState = FormWindowState.Normal; frmLista.FormBorderStyle = FormBorderStyle.FixedSingle; frmLista.StartPosition = FormStartPosition.CenterParent; frmLista.KeyPreview = true; frmLista.MaximizeBox = false; frmLista.MinimizeBox = false; frmLista.ShowInTaskbar = false; frmLista.ShowIcon = false; frmLista.TopMost = true; //Tamnho da Tela //frmLista.Size = new Size(700, 700); ctrlGrid = new DevExpress.XtraGrid.GridControl(); gridLst = new DevExpress.XtraGrid.Views.Grid.GridView(); ctrlGrid.Name = "ctrlGrid"; ctrlGrid.MainView = gridLst; gridLst.Name = "Grid"; gridLst.GridControl = ctrlGrid; ctrlGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridLst }); ctrlGrid.SetBounds(10, 60, iWidth - 20, iHeight - 85); ctrlGrid.DataSource = tbDadosLista; ctrlGrid.BindingContext = new BindingContext(); ctrlGrid.ForceInitialize(); gridLst.OptionsView.ShowFilterPanelMode = DevExpress.XtraGrid.Views.Base.ShowFilterPanelMode.Never; gridLst.OptionsView.ColumnAutoWidth = false; List <List <Object> > colunas = Conexao.getInstance().toList( " select nr_coluna,ds_titulocoluna,nm_campoinstrsql,nr_larguracampo,ds_alinhamentocampo " + " from listavalorescolunas " + " where nr_sequencial = " + inrLista); if (colunas != null) { if (multiselecao) { RepositoryItemCheckEdit selectdp = new RepositoryItemCheckEdit(); gridLst.Columns[0].ColumnEdit = selectdp; selectdp.NullText = "N"; selectdp.ValueChecked = "S"; selectdp.ValueUnchecked = "N"; selectdp.ValueGrayed = "N"; gridLst.Columns[0].Width = 25; gridLst.Columns[0].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; gridLst.Columns[0].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; //gridLst.Columns[0].AppearanceHeader.Font = new Font("Tahoma", 9, FontStyle.Bold); gridLst.Columns[0].Caption = ""; } foreach (List <Object> col in colunas) { Int32 nrColuna = multiselecao ? Convert.ToInt32(col.ElementAt(0)) + 1 : Convert.ToInt32(col.ElementAt(0)); gridLst.Columns[nrColuna - 1].Width = Convert.ToInt32(col.ElementAt(3)); gridLst.Columns[nrColuna - 1].OptionsColumn.AllowEdit = false; gridLst.Columns[nrColuna - 1].OptionsColumn.ReadOnly = true; gridLst.Columns[nrColuna - 1].Caption = Convert.ToString(col.ElementAt(1)); if ((col.ElementAt(4) != null ? col.ElementAt(4).ToString() : "Centralizado") == "Direita") { gridLst.Columns[nrColuna - 1].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; gridLst.Columns[nrColuna - 1].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; gridLst.Columns[nrColuna - 1].AppearanceHeader.Font = new Font("Tahoma", 9, FontStyle.Bold); } if ((col.ElementAt(4) != null ? col.ElementAt(4).ToString() : "Centralizado") == "Esquerda") { gridLst.Columns[nrColuna - 1].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; gridLst.Columns[nrColuna - 1].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; gridLst.Columns[nrColuna - 1].AppearanceHeader.Font = new Font("Tahoma", 9, FontStyle.Bold); } if ((col.ElementAt(4) != null ? col.ElementAt(4).ToString() : "Centralizado") == "Centralizado") { gridLst.Columns[nrColuna - 1].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; gridLst.Columns[nrColuna - 1].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; gridLst.Columns[nrColuna - 1].AppearanceHeader.Font = new Font("Tahoma", 9, FontStyle.Bold); } } } gridLst.GroupPanelText = "Arraste o Título das Colunas para Agrupar."; gridLst.Appearance.GroupPanel.Font = new Font("Tahoma", 9, FontStyle.Bold); gridLst.OptionsSelection.MultiSelect = multiselecao; gridLst.GroupPanelText = "Arraste o Título das Colunas para Agrupar."; gridLst.Appearance.GroupPanel.Font = new Font("Tahoma", 9, FontStyle.Bold); gridLst.OptionsSelection.MultiSelect = multiselecao; LabelControl lbFiltro = new LabelControl(); LabelControl lbInfo = new LabelControl(); TextEdit txtdsFiltro = new TextEdit(); lbFiltro.Text = "Filtro:"; lbFiltro.Font = new Font("Tahoma", 9, FontStyle.Bold); lbFiltro.SetBounds(7, 23, 50, 15); lbInfo.Font = new Font("Tahoma", 9, FontStyle.Bold); lbInfo.Text = "Duplo Clique no Registro para Confirmar a Seleção"; lbInfo.SetBounds(10, iHeight - 15, 350, 13); txtdsFiltro.Font = new Font("Tahoma", 9, FontStyle.Regular); txtdsFiltro.SetBounds(60, 20, 300, 20); txtdsFiltro.Properties.CharacterCasing = CharacterCasing.Upper; txtdsFiltro.TabIndex = 0; txtdsFiltro.TextChanged += new EventHandler(dsFiltroChanged); txtdsFiltro.KeyDown += new KeyEventHandler(dsFiltroEnter); ctrlGrid.TabIndex = 1; ctrlGrid.KeyDown += new KeyEventHandler(dsFiltroEnter); if (!multiselecao) { ctrlGrid.DoubleClick += new EventHandler(SelecionaRegistro); } frmLista.KeyDown += new KeyEventHandler(Escape); SimpleButton btnConfirmar = new SimpleButton(); btnConfirmar.SetBounds(iWidth - 110, iHeight - 20, 100, 25); btnConfirmar.Text = "Confirmar"; btnConfirmar.Font = new Font(btnConfirmar.Font, FontStyle.Bold); btnConfirmar.Font = new Font("Tahoma", 9, FontStyle.Bold); btnConfirmar.Click += new EventHandler(SelecionaRegistro); btnConfirmar.Image = Properties.Resources.Apply_16x16; //Desabilita a opção de agrupamento gridLst.OptionsView.ShowGroupPanel = false; frmLista.Controls.AddRange(new Control[] { ctrlGrid, lbFiltro, txtdsFiltro, lbInfo, btnConfirmar }); frmLista.ShowDialog(); frmLista.BringToFront(); } catch (Exception erro) { Alert.erro("Erro: " + erro.Message); } return(objRetorno); }
public DataTable TimkiemTheoMa(TextEdit txt2) { if (txt2.Text != "") { return DA.TbView("select * from NhanVien Where MaNhanVien='" + txt2.Text + "'"); } else { return DA.TbView("select * from NhanVien"); } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); this.spinEdit1 = new DevExpress.XtraEditors.SpinEdit(); this.label2 = new System.Windows.Forms.Label(); this.textEdit1 = new DevExpress.XtraEditors.TextEdit(); this.label3 = new System.Windows.Forms.Label(); this.spinEdit2 = new DevExpress.XtraEditors.SpinEdit(); this.label4 = new System.Windows.Forms.Label(); this.spinEdit3 = new DevExpress.XtraEditors.SpinEdit(); this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton(); this.simpleButton2 = new DevExpress.XtraEditors.SimpleButton(); ((System.ComponentModel.ISupportInitialize)(this.spinEdit1.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.spinEdit2.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.spinEdit3.Properties)).BeginInit(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(31, 33); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(67, 14); this.label1.TabIndex = 0; this.label1.Text = "预测名称:"; // // spinEdit1 // this.spinEdit1.EditValue = new decimal(new int[] { 1980, 0, 0, 0 }); this.spinEdit1.Location = new System.Drawing.Point(128, 71); this.spinEdit1.Name = "spinEdit1"; this.spinEdit1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton() }); this.spinEdit1.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric; this.spinEdit1.Properties.IsFloatValue = false; this.spinEdit1.Properties.Mask.EditMask = "####"; this.spinEdit1.Properties.MaxValue = new decimal(new int[] { 2050, 0, 0, 0 }); this.spinEdit1.Properties.MinValue = new decimal(new int[] { 1980, 0, 0, 0 }); this.spinEdit1.Size = new System.Drawing.Size(228, 21); this.spinEdit1.TabIndex = 2; this.spinEdit1.EditValueChanged += new System.EventHandler(this.spinEdit1_EditValueChanged); this.spinEdit1.Enter += new System.EventHandler(this.spinEdit1_Enter); // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(31, 74); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(67, 14); this.label2.TabIndex = 2; this.label2.Text = "起始年份:"; // // textEdit1 // this.textEdit1.ImeMode = System.Windows.Forms.ImeMode.On; this.textEdit1.Location = new System.Drawing.Point(128, 30); this.textEdit1.Name = "textEdit1"; this.textEdit1.Properties.MaxLength = 100; this.textEdit1.Size = new System.Drawing.Size(228, 21); this.textEdit1.TabIndex = 1; this.textEdit1.EditValueChanged += new System.EventHandler(this.textEdit1_EditValueChanged); // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(31, 117); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(67, 14); this.label3.TabIndex = 5; this.label3.Text = "结束年份:"; // // spinEdit2 // this.spinEdit2.EditValue = new decimal(new int[] { 1980, 0, 0, 0 }); this.spinEdit2.Location = new System.Drawing.Point(128, 114); this.spinEdit2.Name = "spinEdit2"; this.spinEdit2.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton() }); this.spinEdit2.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric; this.spinEdit2.Properties.IsFloatValue = false; this.spinEdit2.Properties.Mask.EditMask = "####"; this.spinEdit2.Properties.MaxValue = new decimal(new int[] { 2050, 0, 0, 0 }); this.spinEdit2.Properties.MinValue = new decimal(new int[] { 1980, 0, 0, 0 }); this.spinEdit2.Size = new System.Drawing.Size(228, 21); this.spinEdit2.TabIndex = 3; this.spinEdit2.Enter += new System.EventHandler(this.spinEdit2_Enter); // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(31, 163); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(91, 14); this.label4.TabIndex = 7; this.label4.Text = "历史数据年数:"; // // spinEdit3 // this.spinEdit3.EditValue = new decimal(new int[] { 10, 0, 0, 0 }); this.spinEdit3.Location = new System.Drawing.Point(128, 160); this.spinEdit3.Name = "spinEdit3"; this.spinEdit3.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton() }); this.spinEdit3.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric; this.spinEdit3.Properties.IsFloatValue = false; this.spinEdit3.Properties.Mask.EditMask = "##"; this.spinEdit3.Properties.MaxValue = new decimal(new int[] { 50, 0, 0, 0 }); this.spinEdit3.Properties.MinValue = new decimal(new int[] { 1, 0, 0, 0 }); this.spinEdit3.Size = new System.Drawing.Size(228, 21); this.spinEdit3.TabIndex = 4; this.spinEdit3.Enter += new System.EventHandler(this.spinEdit3_Enter); // // simpleButton1 // this.simpleButton1.Location = new System.Drawing.Point(181, 221); this.simpleButton1.Name = "simpleButton1"; this.simpleButton1.Size = new System.Drawing.Size(75, 26); this.simpleButton1.TabIndex = 5; this.simpleButton1.Text = "确定(&O)"; this.simpleButton1.Click += new System.EventHandler(this.simpleButton1_Click); // // simpleButton2 // this.simpleButton2.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.simpleButton2.Location = new System.Drawing.Point(281, 221); this.simpleButton2.Name = "simpleButton2"; this.simpleButton2.Size = new System.Drawing.Size(75, 26); this.simpleButton2.TabIndex = 6; this.simpleButton2.Text = "取消(&C)"; // // FormForecastReport // this.AcceptButton = this.simpleButton1; this.CancelButton = this.simpleButton2; this.ClientSize = new System.Drawing.Size(384, 267); this.Controls.Add(this.simpleButton2); this.Controls.Add(this.simpleButton1); this.Controls.Add(this.label4); this.Controls.Add(this.spinEdit3); this.Controls.Add(this.label3); this.Controls.Add(this.spinEdit2); this.Controls.Add(this.textEdit1); this.Controls.Add(this.label2); this.Controls.Add(this.spinEdit1); this.Controls.Add(this.label1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "FormForecastReport"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "FormForecastReport"; this.Load += new System.EventHandler(this.FormForecastReport_Load); ((System.ComponentModel.ISupportInitialize)(this.spinEdit1.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.spinEdit2.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.spinEdit3.Properties)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
/*Load hình ảnh vào textbox*/ public void LoadDuLieuText(TextEdit txtMNV, TextEdit txtTNV, TextEdit txtDC, TextEdit txtSDT, TextEdit txtTDN, string strSite, PictureBox ptB) { string mnv = frmDangNhap.MaNhanVien; DataTable dt = DA.TbView(@"Select MaNhanVien,TenNhanVien,DiaChi, SoDienThoai,ChucVu,TenDangNhap,MatKhau,AnhDaiDien,Site From NhanVien Where MaNhanVien='" + mnv + "'"); txtMNV.Text = dt.Rows[0]["MaNhanVien"].ToString().Trim(); txtTNV.Text = dt.Rows[0]["TenNhanVien"].ToString().Trim(); txtDC.Text = dt.Rows[0]["DiaChi"].ToString().Trim(); txtSDT.Text = dt.Rows[0]["SoDienThoai"].ToString().Trim(); txtTDN.Text = dt.Rows[0]["TenDangNhap"].ToString().Trim(); strSite = dt.Rows[0]["Site"].ToString().Trim(); Image myImage = ByteArrayToImage((byte[])dt.Rows[0]["AnhDaiDien"]); ptB.Image = myImage; }
void LimpiearEntradas(TextEdit entrada1, MemoEdit entrada2) { entrada1.Text = string.Empty; entrada2.Text = string.Empty; }
public async Task HandleRequestAsync_InvokesCSharpLanguageServer_RemapsResults() { // Arrange var invokedCSharpServer = false; var remapped = false; var expectedEdit = new TextEdit(); var remappedEdit = new TextEdit(); var documentManager = new TestDocumentManager(); var snapshot = new StringTextSnapshot(@" @code { public string _foo; }"); documentManager.AddDocument(Uri, Mock.Of <LSPDocumentSnapshot>(m => m.Snapshot == snapshot, MockBehavior.Strict)); var requestInvoker = new Mock <LSPRequestInvoker>(MockBehavior.Strict); requestInvoker .Setup(r => r.ReinvokeRequestOnServerAsync <DocumentOnTypeFormattingParams, TextEdit[]>(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <DocumentOnTypeFormattingParams>(), It.IsAny <CancellationToken>())) .Callback <string, string, DocumentOnTypeFormattingParams, CancellationToken>((method, serverContentType, onTypeFormattingParams, ct) => { Assert.Equal(Methods.TextDocumentOnTypeFormattingName, method); Assert.Equal(RazorLSPConstants.CSharpContentTypeName, serverContentType); invokedCSharpServer = true; }) .Returns(Task.FromResult(new[] { expectedEdit })); var projectionResult = new ProjectionResult() { LanguageKind = RazorLanguageKind.CSharp, }; var projectionProvider = new Mock <LSPProjectionProvider>(MockBehavior.Strict); projectionProvider.Setup(p => p.GetProjectionAsync(It.IsAny <LSPDocumentSnapshot>(), It.IsAny <Position>(), It.IsAny <CancellationToken>())).Returns(Task.FromResult(projectionResult)); var mappingProvider = new Mock <LSPDocumentMappingProvider>(MockBehavior.Strict); mappingProvider .Setup(m => m.RemapFormattedTextEditsAsync(It.IsAny <Uri>(), It.IsAny <TextEdit[]>(), It.IsAny <FormattingOptions>(), It.IsAny <bool>(), It.IsAny <CancellationToken>())) .Callback(() => { remapped = true; }) .Returns(Task.FromResult(new[] { remappedEdit })); var formatOnTypeHandler = new OnTypeFormattingHandler(documentManager, requestInvoker.Object, projectionProvider.Object, mappingProvider.Object); var formattingRequest = new DocumentOnTypeFormattingParams() { TextDocument = new TextDocumentIdentifier() { Uri = Uri }, Position = new Position(2, 19), Character = ";", Options = new FormattingOptions() }; // Act var result = await formatOnTypeHandler.HandleRequestAsync(formattingRequest, new ClientCapabilities(), CancellationToken.None).ConfigureAwait(false); // Assert Assert.True(invokedCSharpServer); Assert.True(remapped); var edit = Assert.Single(result); Assert.Same(remappedEdit, edit); }
public static void SetEditedCell(DependencyObject obj, TextEdit value) { obj.SetValue(EditedCellProperty, value); }
private void InitializeTablePanel() { int boxCount = 0; TableLayoutPanel tablePanel = new TableLayoutPanel(); tablePanel.SuspendLayout(); tablePanel.Name = "TablePanelNew"; tablePanel.TabIndex = 0; tablePanel.Font = new System.Drawing.Font("Arial", 11F); tablePanel.Size = new System.Drawing.Size(950, 130); tablePanel.Location = new System.Drawing.Point((this.Panel02.Width - tablePanel.Width) / 2, 19); tablePanel.Anchor = (AnchorStyles)((AnchorStyles.Top | AnchorStyles.Left) | AnchorStyles.Right); tablePanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Inset; tablePanel.ColumnCount = sampleQty + 1; for (int i = 0; i < tablePanel.ColumnCount; i++) { tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F)); } tablePanel.RowCount = paramQty + 1; for (int i = 0; i <= tablePanel.RowCount; i++) { tablePanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F)); } for (int i = 0; i < tablePanel.RowCount; i++) { for (int j = 0; j < tablePanel.ColumnCount; j++) { if (i == 0 && j == 0) { continue; } if (i == 0) { LabelControl lblCtrl = new LabelControl(); lblCtrl.Size = new System.Drawing.Size(24, 17); lblCtrl.Anchor = AnchorStyles.Top; lblCtrl.Appearance.Font = new System.Drawing.Font("Arial", 11F); lblCtrl.Location = new System.Drawing.Point(0, 0); lblCtrl.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003; lblCtrl.LookAndFeel.UseDefaultLookAndFeel = false; lblCtrl.Appearance.Options.UseFont = true; lblCtrl.TabIndex = 0; lblCtrl.Text = j.ToString() + "片"; tablePanel.Controls.Add(lblCtrl, j, i); } else if (j == 0) { LabelControl lblCtrl = new LabelControl(); lblCtrl.Name = "lblCtrl" + i.ToString("00"); lblCtrl.Size = new System.Drawing.Size(80, 17); lblCtrl.Anchor = AnchorStyles.Top; lblCtrl.Appearance.Font = new System.Drawing.Font("Arial", 11F); lblCtrl.Location = new System.Drawing.Point(0, 0); lblCtrl.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003; lblCtrl.LookAndFeel.UseDefaultLookAndFeel = false; lblCtrl.Appearance.Options.UseFont = true; lblCtrl.TabIndex = 0; switch (_edcData.DataType) { case "R": switch (i) { case 1: lblCtrl.Tag = "1"; lblCtrl.Text = "刻蚀前电阻"; break; case 2: lblCtrl.Tag = "2"; lblCtrl.Text = "刻蚀后电阻"; break; case 3: lblCtrl.Tag = "3"; lblCtrl.Text = "电阻提升量"; break; default: break; } break; case "W": switch (i) { case 1: lblCtrl.Tag = "1"; lblCtrl.Text = "清洗前称重"; break; case 2: lblCtrl.Tag = "2"; lblCtrl.Text = "清洗后称重"; break; case 3: lblCtrl.Tag = "3"; lblCtrl.Text = "清洗减薄量"; break; default: break; } break; default: break; } tablePanel.Controls.Add(lblCtrl, j, i); } else { TextEdit txtBox = new TextEdit(); boxCount++; ((ISupportInitialize)(txtBox.Properties)).BeginInit(); txtBox.Dock = System.Windows.Forms.DockStyle.Top; txtBox.Location = new System.Drawing.Point(0, 0); txtBox.Name = "txtBox" + boxCount.ToString("00"); txtBox.Properties.Appearance.Font = new System.Drawing.Font("Arial", 12F); txtBox.Properties.Appearance.Options.UseFont = true; txtBox.Properties.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003; txtBox.Properties.LookAndFeel.UseDefaultLookAndFeel = false; txtBox.Size = new System.Drawing.Size(160, 25); txtBox.Properties.ReadOnly = true; txtBox.TabIndex = boxCount; ((ISupportInitialize)(txtBox.Properties)).EndInit(); txtBox.TextChanged += (s, e) => { TextEdit txtEdit = s as TextEdit; if (txtEdit.Text != string.Empty) { int boxIndex = int.Parse(txtEdit.Name.Substring(txtEdit.Name.Length - 2)); if (boxIndex > sampleQty * (paramQty - 2) && boxIndex <= sampleQty * (paramQty - 1)) { TextEdit prevBox = this.Panel02.Controls.Find("txtBox" + ((boxIndex - sampleQty * (paramQty - 2))).ToString("00"), true)[0] as TextEdit; TextEdit nextBox = this.Panel02.Controls.Find("txtBox" + boxIndex.ToString("00"), true)[0] as TextEdit; TextEdit calcBox = this.Panel02.Controls.Find("txtBox" + ((sampleQty * (paramQty - 1)) + (boxIndex - sampleQty * (paramQty - 2))).ToString("00"), true)[0] as TextEdit; calcBox.Text = (Convert.ToDouble(prevBox.Text) - Convert.ToDouble(nextBox.Text)).ToString(); } int lblIndex = ((boxIndex - 1) / sampleQty) + 1; LabelControl lblCtrl = this.Panel02.Controls.Find("lblCtrl" + lblIndex.ToString("00"), true)[0] as LabelControl; List <string> listValue; if (_edcData.SHRDic.TryGetValue(lblCtrl.Tag.ToString(), out listValue)) { listValue.Add(txtEdit.Text); } else { _edcData.SHRDic.Add(lblCtrl.Tag.ToString(), new List <string>() { txtEdit.Text }); } } }; tablePanel.Controls.Add(txtBox, j, i); } } } tablePanel.ResumeLayout(false); tablePanel.PerformLayout(); this.Panel02.Controls.Add(tablePanel); }
public override void _Ready() { editor = GetNode <TextEdit>("/root/Window/VB/MainHB/Editor"); preview = GetNode <TextPreview>("/root/Window/VB/MainHB/TextPreview"); }
private double Total_Truong12(TextEdit txt1, TextEdit txt2, TextEdit txt3, TextEdit txt4, TextEdit txt5, TextEdit txt6) { double x1 = 0, x2 = 0, x3 = 0, x4 = 0, x5 = 0, x6 = 0, T = 0; if (Global.FlagTong) { try { if (!string.IsNullOrEmpty(txt1.Text)) { x1 = double.Parse(txt1.Text.Replace(",", "")); } } catch (Exception) { // ignored } try { if (!string.IsNullOrEmpty(txt2.Text)) { x2 = double.Parse(txt2.Text.Replace(",", "")); } } catch (Exception) { // ignored } try { if (!string.IsNullOrEmpty(txt3.Text)) { x3 = double.Parse(txt3.Text.Replace(",", "")); } } catch (Exception) { // ignored } try { if (!string.IsNullOrEmpty(txt4.Text)) { x4 = double.Parse(txt4.Text.Replace(",", "")); } } catch (Exception) { // ignored } try { if (!string.IsNullOrEmpty(txt5.Text)) { x5 = double.Parse(txt5.Text.Replace(",", "")); } } catch (Exception) { // ignored } try { if (!string.IsNullOrEmpty(txt6.Text)) { x6 = double.Parse(txt6.Text.Replace(",", "")); } } catch (Exception) { // ignored } try { T = x1 + x2 + x3 + x4 + x5 + x6; Tong_truong18 = T / 3; } catch (Exception) { // ignored } } return(T); }
private void InitializeComponent() { this.components = new Container(); ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(FormMain)); this.panelControl1 = new PanelControl(); this.panelControl5 = new PanelControl(); this.labelControl2 = new LabelControl(); this.labelControl1 = new LabelControl(); this.panelControl3 = new PanelControl(); this.labelControl6 = new LabelControl(); this.labelControl5 = new LabelControl(); this.ribbonControl1 = new RibbonControl(); this.ribbonGalleryBarItem1 = new RibbonGalleryBarItem(); this.barButtonItem1 = new BarButtonItem(); this.barButtonItem2 = new BarButtonItem(); this.ribbonPage1 = new RibbonPage(); this.ribbonPageGroup1 = new RibbonPageGroup(); this.ribbonPageGroup2 = new RibbonPageGroup(); this.repositoryItemPictureEdit1 = new RepositoryItemPictureEdit(); this.repositoryItemPictureEdit2 = new RepositoryItemPictureEdit(); this.repositoryItemPictureEdit3 = new RepositoryItemPictureEdit(); this.repositoryItemPictureEdit4 = new RepositoryItemPictureEdit(); this.panelControl6 = new PanelControl(); this.panelControl2 = new PanelControl(); this.pictureEdit9 = new PictureEdit(); this.panelControl4 = new PanelControl(); this.simpleButton5 = new SimpleButton(); this.simpleButton2 = new SimpleButton(); this.textEdit1 = new TextEdit(); this.simpleButton1 = new SimpleButton(); this.simpleButton4 = new SimpleButton(); this.simpleButton3 = new SimpleButton(); this.imageCollection1 = new ImageCollection(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components); this.navBarControl1 = new NavBarControl(); this.navBarGroup1 = new NavBarGroup(); this.navBarItem8 = new NavBarItem(); this.navBarItem1 = new NavBarItem(); this.navBarItem2 = new NavBarItem(); this.navBarItem3 = new NavBarItem(); this.navBarItem4 = new NavBarItem(); this.navBarItem5 = new NavBarItem(); this.navBarItem6 = new NavBarItem(); this.navBarItem7 = new NavBarItem(); this.xtraTabbedMdiManager1 = new XtraTabbedMdiManager(this.components); this.barManager1 = new BarManager(this.components); this.bar3 = new Bar(); this.barStaticItem1 = new BarStaticItem(); this.barStaticItem2 = new BarStaticItem(); this.barDockControlTop = new BarDockControl(); this.barDockControlBottom = new BarDockControl(); this.barDockControlLeft = new BarDockControl(); this.barDockControlRight = new BarDockControl(); this.timer2 = new System.Windows.Forms.Timer(this.components); ((ISupportInitialize)this.panelControl1).BeginInit(); this.panelControl1.SuspendLayout(); ((ISupportInitialize)this.panelControl5).BeginInit(); this.panelControl5.SuspendLayout(); ((ISupportInitialize)this.panelControl3).BeginInit(); this.panelControl3.SuspendLayout(); ((ISupportInitialize)this.ribbonControl1).BeginInit(); ((ISupportInitialize)this.repositoryItemPictureEdit1).BeginInit(); ((ISupportInitialize)this.repositoryItemPictureEdit2).BeginInit(); ((ISupportInitialize)this.repositoryItemPictureEdit3).BeginInit(); ((ISupportInitialize)this.repositoryItemPictureEdit4).BeginInit(); ((ISupportInitialize)this.panelControl6).BeginInit(); this.panelControl6.SuspendLayout(); ((ISupportInitialize)this.panelControl2).BeginInit(); this.panelControl2.SuspendLayout(); ((ISupportInitialize)this.pictureEdit9.Properties).BeginInit(); ((ISupportInitialize)this.panelControl4).BeginInit(); this.panelControl4.SuspendLayout(); ((ISupportInitialize)this.textEdit1.Properties).BeginInit(); ((ISupportInitialize)this.imageCollection1).BeginInit(); ((ISupportInitialize)this.navBarControl1).BeginInit(); ((ISupportInitialize)this.xtraTabbedMdiManager1).BeginInit(); ((ISupportInitialize)this.barManager1).BeginInit(); base.SuspendLayout(); this.panelControl1.Controls.Add(this.panelControl5); this.panelControl1.Controls.Add(this.panelControl3); this.panelControl1.Controls.Add(this.ribbonControl1); this.panelControl1.Dock = DockStyle.Top; this.panelControl1.Location = new Point(0, 0); this.panelControl1.Name = "panelControl1"; this.panelControl1.Size = new Size(826, 99); this.panelControl1.TabIndex = 3; this.panelControl5.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right); this.panelControl5.Controls.Add(this.labelControl2); this.panelControl5.Controls.Add(this.labelControl1); this.panelControl5.Location = new Point(635, 6); this.panelControl5.Name = "panelControl5"; this.panelControl5.Size = new Size(167, 88); this.panelControl5.TabIndex = 8; this.labelControl2.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); this.labelControl2.Appearance.TextOptions.HAlignment = HorzAlignment.Near; this.labelControl2.Location = new Point(24, 55); this.labelControl2.Name = "labelControl2"; this.labelControl2.Size = new Size(84, 14); this.labelControl2.TabIndex = 1; this.labelControl2.Text = "发动机转速:无"; this.labelControl1.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right); this.labelControl1.Location = new Point(22, 17); this.labelControl1.Name = "labelControl1"; this.labelControl1.Size = new Size(120, 14); this.labelControl1.TabIndex = 0; this.labelControl1.Text = "发动机冷却液温度:无"; this.panelControl3.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right); this.panelControl3.Controls.Add(this.labelControl6); this.panelControl3.Controls.Add(this.labelControl5); this.panelControl3.Location = new Point(319, 5); this.panelControl3.Name = "panelControl3"; this.panelControl3.Size = new Size(225, 88); this.panelControl3.TabIndex = 2; this.panelControl3.Resize += new EventHandler(this.panelControl3_Resize); this.labelControl6.Appearance.Font = new Font("Tahoma", 10.5f, FontStyle.Regular, GraphicsUnit.Point, 0); this.labelControl6.Location = new Point(83, 34); this.labelControl6.Name = "labelControl6"; this.labelControl6.Size = new Size(79, 17); this.labelControl6.TabIndex = 1; this.labelControl6.Text = "labelControl6"; this.labelControl5.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); this.labelControl5.Appearance.Font = new Font("Tahoma", 15f, FontStyle.Bold, GraphicsUnit.Point, 0); this.labelControl5.Appearance.ForeColor = Color.Orange; this.labelControl5.Appearance.TextOptions.HAlignment = HorzAlignment.Center; this.labelControl5.Appearance.TextOptions.VAlignment = VertAlignment.Center; this.labelControl5.Location = new Point(60, 5); this.labelControl5.Name = "labelControl5"; this.labelControl5.Size = new Size(135, 24); this.labelControl5.TabIndex = 0; this.labelControl5.Text = "labelControl5"; this.ribbonControl1.AllowKeyTips = false; this.ribbonControl1.AllowMdiChildButtons = false; this.ribbonControl1.AllowMinimizeRibbon = false; this.ribbonControl1.AllowTrimPageText = false; this.ribbonControl1.ApplicationButtonDropDownControl = this.barDockControlRight; this.ribbonControl1.ExpandCollapseItem.Id = 0; this.ribbonControl1.Items.AddRange(new BarItem[] { this.ribbonControl1.ExpandCollapseItem, this.ribbonGalleryBarItem1, this.barButtonItem1, this.barButtonItem2 }); this.ribbonControl1.Location = new Point(2, 2); this.ribbonControl1.MaxItemId = 1; this.ribbonControl1.Name = "ribbonControl1"; this.ribbonControl1.Pages.AddRange(new RibbonPage[] { this.ribbonPage1 }); this.ribbonControl1.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemPictureEdit1, this.repositoryItemPictureEdit2, this.repositoryItemPictureEdit3, this.repositoryItemPictureEdit4 }); this.ribbonControl1.RightToLeft = RightToLeft.Yes; this.ribbonControl1.ShowCategoryInCaption = false; this.ribbonControl1.ShowExpandCollapseButton = DefaultBoolean.False; this.ribbonControl1.ShowFullScreenButton = DefaultBoolean.False; this.ribbonControl1.ShowPageHeadersMode = ShowPageHeadersMode.Hide; this.ribbonControl1.ShowToolbarCustomizeItem = false; this.ribbonControl1.Size = new Size(822, 98); this.ribbonControl1.Toolbar.ShowCustomizeItem = false; this.ribbonControl1.ToolbarLocation = RibbonQuickAccessToolbarLocation.Hidden; this.ribbonGalleryBarItem1.Caption = "ribbonGalleryBarItem1"; this.ribbonGalleryBarItem1.CategoryGuid = new Guid("6ffddb2b-9015-4d97-a4c1-91613e0ef537"); this.ribbonGalleryBarItem1.Gallery.ItemClick += new GalleryItemClickEventHandler(this.ribbonGalleryBarItem1_GalleryItemClick); this.ribbonGalleryBarItem1.Id = 1; this.ribbonGalleryBarItem1.Name = "ribbonGalleryBarItem1"; this.ribbonGalleryBarItem1.GalleryItemClick += new GalleryItemClickEventHandler(this.ribbonGalleryBarItem1_GalleryItemClick); this.barButtonItem1.Caption = "最小化"; this.barButtonItem1.CategoryGuid = new Guid("6ffddb2b-9015-4d97-a4c1-91613e0ef537"); this.barButtonItem1.Glyph = (Image)componentResourceManager.GetObject("barButtonItem1.Glyph"); this.barButtonItem1.Id = 12; this.barButtonItem1.LargeGlyph = (Image)componentResourceManager.GetObject("barButtonItem1.LargeGlyph"); this.barButtonItem1.Name = "barButtonItem1"; this.barButtonItem1.ItemClick += new ItemClickEventHandler(this.barButtonItem1_ItemClick); this.barButtonItem2.Caption = "关闭"; this.barButtonItem2.CategoryGuid = new Guid("6ffddb2b-9015-4d97-a4c1-91613e0ef537"); this.barButtonItem2.Glyph = (Image)componentResourceManager.GetObject("barButtonItem2.Glyph"); this.barButtonItem2.Id = 13; this.barButtonItem2.LargeGlyph = (Image)componentResourceManager.GetObject("barButtonItem2.LargeGlyph"); this.barButtonItem2.Name = "barButtonItem2"; this.barButtonItem2.ItemClick += new ItemClickEventHandler(this.barButtonItem2_ItemClick); this.ribbonPage1.Groups.AddRange(new RibbonPageGroup[] { this.ribbonPageGroup1, this.ribbonPageGroup2 }); this.ribbonPage1.Name = "ribbonPage1"; this.ribbonPage1.Text = "ribbonPage1"; this.ribbonPageGroup1.AllowTextClipping = false; this.ribbonPageGroup1.ItemLinks.Add(this.ribbonGalleryBarItem1); this.ribbonPageGroup1.Name = "ribbonPageGroup1"; this.ribbonPageGroup1.ShowCaptionButton = false; this.ribbonPageGroup1.Text = "换肤"; this.ribbonPageGroup2.AllowMinimize = false; this.ribbonPageGroup2.AllowTextClipping = false; this.ribbonPageGroup2.ItemLinks.Add(this.barButtonItem1); this.ribbonPageGroup2.ItemLinks.Add(this.barButtonItem2); this.ribbonPageGroup2.Name = "ribbonPageGroup2"; this.ribbonPageGroup2.ShowCaptionButton = false; this.repositoryItemPictureEdit1.Name = "repositoryItemPictureEdit1"; this.repositoryItemPictureEdit2.Name = "repositoryItemPictureEdit2"; this.repositoryItemPictureEdit3.Name = "repositoryItemPictureEdit3"; this.repositoryItemPictureEdit3.PictureAlignment = ContentAlignment.MiddleLeft; this.repositoryItemPictureEdit4.Name = "repositoryItemPictureEdit4"; this.panelControl6.Controls.Add(this.panelControl2); this.panelControl6.Controls.Add(this.panelControl4); this.panelControl6.Dock = DockStyle.Bottom; this.panelControl6.Location = new Point(167, 189); this.panelControl6.Name = "panelControl6"; this.panelControl6.Size = new Size(659, 391); this.panelControl6.TabIndex = 2; this.panelControl6.Visible = false; this.panelControl2.Controls.Add(this.pictureEdit9); this.panelControl2.Dock = DockStyle.Fill; this.panelControl2.Location = new Point(2, 2); this.panelControl2.Name = "panelControl2"; this.panelControl2.Size = new Size(655, 348); this.panelControl2.TabIndex = 2; this.pictureEdit9.BackgroundImage = (Image)componentResourceManager.GetObject("pictureEdit9.BackgroundImage"); this.pictureEdit9.Dock = DockStyle.Fill; this.pictureEdit9.Location = new Point(2, 2); this.pictureEdit9.Name = "pictureEdit9"; this.pictureEdit9.Properties.ShowMenu = false; this.pictureEdit9.Properties.SizeMode = PictureSizeMode.Stretch; this.pictureEdit9.Size = new Size(651, 344); this.pictureEdit9.TabIndex = 0; this.panelControl4.Controls.Add(this.simpleButton5); this.panelControl4.Controls.Add(this.simpleButton2); this.panelControl4.Controls.Add(this.textEdit1); this.panelControl4.Controls.Add(this.simpleButton1); this.panelControl4.Controls.Add(this.simpleButton4); this.panelControl4.Controls.Add(this.simpleButton3); this.panelControl4.Dock = DockStyle.Bottom; this.panelControl4.Location = new Point(2, 350); this.panelControl4.Name = "panelControl4"; this.panelControl4.Size = new Size(655, 39); this.panelControl4.TabIndex = 1; this.simpleButton5.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left); this.simpleButton5.Enabled = false; this.simpleButton5.Location = new Point(81, 2); this.simpleButton5.Name = "simpleButton5"; this.simpleButton5.Size = new Size(78, 35); this.simpleButton5.TabIndex = 16; this.simpleButton5.Text = "关闭仪表显示"; this.simpleButton5.Visible = false; this.simpleButton5.Click += new EventHandler(this.simpleButton5_Click); this.simpleButton2.Dock = DockStyle.Left; this.simpleButton2.Location = new Point(2, 2); this.simpleButton2.Name = "simpleButton2"; this.simpleButton2.Size = new Size(78, 35); this.simpleButton2.TabIndex = 15; this.simpleButton2.Text = "打开仪表显示"; this.simpleButton2.Visible = false; this.simpleButton2.Click += new EventHandler(this.simpleButton2_Click); this.textEdit1.Location = new Point(224, 1); this.textEdit1.MenuManager = this.ribbonControl1; this.textEdit1.Name = "textEdit1"; this.textEdit1.Size = new Size(90, 20); this.textEdit1.TabIndex = 14; this.textEdit1.Visible = false; this.simpleButton1.Location = new Point(320, 0); this.simpleButton1.Name = "simpleButton1"; this.simpleButton1.Size = new Size(86, 23); this.simpleButton1.TabIndex = 13; this.simpleButton1.Text = "定位(测试)"; this.simpleButton1.Visible = false; this.simpleButton1.Click += new EventHandler(this.simpleButton1_Click); this.simpleButton4.Dock = DockStyle.Right; this.simpleButton4.Enabled = false; this.simpleButton4.Location = new Point(570, 2); this.simpleButton4.Name = "simpleButton4"; this.simpleButton4.Size = new Size(83, 35); this.simpleButton4.TabIndex = 12; this.simpleButton4.Text = "关闭检测显示"; this.simpleButton4.Click += new EventHandler(this.simpleButton4_Click); this.simpleButton3.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right); this.simpleButton3.Location = new Point(491, 2); this.simpleButton3.Name = "simpleButton3"; this.simpleButton3.Size = new Size(78, 35); this.simpleButton3.TabIndex = 11; this.simpleButton3.Text = "打开检测显示"; this.simpleButton3.Click += new EventHandler(this.simpleButton3_Click); this.imageCollection1.ImageStream = (ImageCollectionStreamer)componentResourceManager.GetObject("imageCollection1.ImageStream"); this.imageCollection1.Images.SetKeyName(0, "close.png"); this.imageCollection1.Images.SetKeyName(1, "close-01.png"); this.imageCollection1.Images.SetKeyName(2, "small.png"); this.imageCollection1.Images.SetKeyName(3, "small-01.png"); this.imageCollection1.Images.SetKeyName(4, "NoSchematic.png"); this.timer1.Interval = 1000; this.timer1.Tick += new EventHandler(this.timer1_Tick); this.navBarControl1.ActiveGroup = this.navBarGroup1; this.navBarControl1.Dock = DockStyle.Left; this.navBarControl1.Groups.AddRange(new NavBarGroup[] { this.navBarGroup1 }); this.navBarControl1.Items.AddRange(new NavBarItem[] { this.navBarItem1, this.navBarItem2, this.navBarItem3, this.navBarItem4, this.navBarItem5, this.navBarItem6, this.navBarItem7, this.navBarItem8 }); this.navBarControl1.Location = new Point(0, 99); this.navBarControl1.Name = "navBarControl1"; this.navBarControl1.OptionsNavPane.ExpandedWidth = 167; this.navBarControl1.OptionsNavPane.ShowGroupImageInHeader = true; this.navBarControl1.OptionsNavPane.ShowOverflowButton = false; this.navBarControl1.PaintStyleKind = NavBarViewKind.NavigationPane; this.navBarControl1.Size = new Size(167, 481); this.navBarControl1.TabIndex = 7; this.navBarControl1.Text = " "; this.navBarGroup1.Caption = "功能导航"; this.navBarGroup1.Expanded = true; this.navBarGroup1.GroupStyle = NavBarGroupStyle.LargeIconsText; this.navBarGroup1.ItemLinks.AddRange(new NavBarItemLink[] { new NavBarItemLink(this.navBarItem8), new NavBarItemLink(this.navBarItem1), new NavBarItemLink(this.navBarItem2), new NavBarItemLink(this.navBarItem3), new NavBarItemLink(this.navBarItem4), new NavBarItemLink(this.navBarItem5), new NavBarItemLink(this.navBarItem6), new NavBarItemLink(this.navBarItem7) }); this.navBarGroup1.LargeImage = (Image)componentResourceManager.GetObject("navBarGroup1.LargeImage"); this.navBarGroup1.Name = "navBarGroup1"; this.navBarGroup1.TopVisibleLinkIndex = 1; this.navBarItem8.Caption = "模块信息"; this.navBarItem8.LargeImage = (Image)componentResourceManager.GetObject("navBarItem8.LargeImage"); this.navBarItem8.Name = "navBarItem8"; this.navBarItem8.LinkClicked += new NavBarLinkEventHandler(this.navBarItem8_LinkClicked); this.navBarItem1.Appearance.Image = (Image)componentResourceManager.GetObject("navBarItem1.Appearance.Image"); this.navBarItem1.Appearance.Options.UseImage = true; this.navBarItem1.Caption = "历史数据"; this.navBarItem1.LargeImage = (Image)componentResourceManager.GetObject("navBarItem1.LargeImage"); this.navBarItem1.Name = "navBarItem1"; this.navBarItem1.LinkClicked += new NavBarLinkEventHandler(this.navBarItem1_LinkClicked); this.navBarItem2.Caption = "实训考核"; this.navBarItem2.LargeImage = (Image)componentResourceManager.GetObject("navBarItem2.LargeImage"); this.navBarItem2.Name = "navBarItem2"; this.navBarItem2.LinkClicked += new NavBarLinkEventHandler(this.navBarItem2_LinkClicked); this.navBarItem3.Caption = "波形监控"; this.navBarItem3.LargeImage = (Image)componentResourceManager.GetObject("navBarItem3.LargeImage"); this.navBarItem3.Name = "navBarItem3"; this.navBarItem3.Visible = false; this.navBarItem3.LinkClicked += new NavBarLinkEventHandler(this.navBarItem3_LinkClicked); this.navBarItem4.Caption = "历史波形"; this.navBarItem4.LargeImage = (Image)componentResourceManager.GetObject("navBarItem4.LargeImage"); this.navBarItem4.Name = "navBarItem4"; this.navBarItem4.Visible = false; this.navBarItem4.LinkClicked += new NavBarLinkEventHandler(this.navBarItem4_LinkClicked); this.navBarItem5.Caption = "资料共享"; this.navBarItem5.LargeImage = (Image)componentResourceManager.GetObject("navBarItem5.LargeImage"); this.navBarItem5.Name = "navBarItem5"; this.navBarItem5.Visible = false; this.navBarItem5.LinkClicked += new NavBarLinkEventHandler(this.navBarItem5_LinkClicked); this.navBarItem6.Caption = "参数设置"; this.navBarItem6.LargeImage = (Image)componentResourceManager.GetObject("navBarItem6.LargeImage"); this.navBarItem6.Name = "navBarItem6"; this.navBarItem6.LinkClicked += new NavBarLinkEventHandler(this.navBarItem6_LinkClicked); this.navBarItem7.Caption = "查看电路图"; this.navBarItem7.LargeImage = (Image)componentResourceManager.GetObject("navBarItem7.LargeImage"); this.navBarItem7.Name = "navBarItem7"; this.navBarItem7.LinkClicked += new NavBarLinkEventHandler(this.navBarItem7_LinkClicked); this.xtraTabbedMdiManager1.HeaderButtons = TabButtons.None; this.xtraTabbedMdiManager1.HeaderButtonsShowMode = TabButtonShowMode.Never; this.xtraTabbedMdiManager1.MdiParent = this; this.barManager1.Bars.AddRange(new Bar[] { this.bar3 }); this.barManager1.DockControls.Add(this.barDockControlTop); this.barManager1.DockControls.Add(this.barDockControlBottom); this.barManager1.DockControls.Add(this.barDockControlLeft); this.barManager1.DockControls.Add(this.barDockControlRight); this.barManager1.Form = this; this.barManager1.Items.AddRange(new BarItem[] { this.barStaticItem1, this.barStaticItem2 }); this.barManager1.MaxItemId = 2; this.barManager1.StatusBar = this.bar3; this.bar3.BarName = "Status bar"; this.bar3.CanDockStyle = BarCanDockStyle.Bottom; this.bar3.DockCol = 0; this.bar3.DockRow = 0; this.bar3.DockStyle = BarDockStyle.Bottom; this.bar3.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(this.barStaticItem1), new LinkPersistInfo(this.barStaticItem2) }); this.bar3.OptionsBar.AllowQuickCustomization = false; this.bar3.OptionsBar.DrawDragBorder = false; this.bar3.OptionsBar.UseWholeRow = true; this.bar3.Text = "Status bar"; this.barStaticItem1.Caption = "当前登录用户:"; this.barStaticItem1.Id = 0; this.barStaticItem1.Name = "barStaticItem1"; this.barStaticItem1.TextAlignment = StringAlignment.Near; this.barStaticItem2.Alignment = BarItemLinkAlignment.Right; this.barStaticItem2.Caption = "系统时间:"; this.barStaticItem2.Id = 1; this.barStaticItem2.Name = "barStaticItem2"; this.barStaticItem2.TextAlignment = StringAlignment.Near; this.barDockControlTop.CausesValidation = false; this.barDockControlTop.Dock = DockStyle.Top; this.barDockControlTop.Location = new Point(0, 0); this.barDockControlTop.Size = new Size(826, 0); this.barDockControlBottom.CausesValidation = false; this.barDockControlBottom.Dock = DockStyle.Bottom; this.barDockControlBottom.Location = new Point(0, 580); this.barDockControlBottom.Size = new Size(826, 27); this.barDockControlLeft.CausesValidation = false; this.barDockControlLeft.Dock = DockStyle.Left; this.barDockControlLeft.Location = new Point(0, 0); this.barDockControlLeft.Size = new Size(0, 580); this.barDockControlRight.CausesValidation = false; this.barDockControlRight.Dock = DockStyle.Right; this.barDockControlRight.Location = new Point(826, 0); this.barDockControlRight.Size = new Size(0, 580); this.timer2.Interval = 500; this.timer2.Tick += new EventHandler(this.timer2_Tick); base.AutoScaleDimensions = new SizeF(7f, 14f); base.AutoScaleMode = AutoScaleMode.Font; base.ClientSize = new Size(826, 607); base.Controls.Add(this.panelControl6); base.Controls.Add(this.navBarControl1); base.Controls.Add(this.panelControl1); base.Controls.Add(this.barDockControlLeft); base.Controls.Add(this.barDockControlRight); base.Controls.Add(this.barDockControlBottom); base.Controls.Add(this.barDockControlTop); base.FormBorderStyle = FormBorderStyle.None; base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon"); base.IsMdiContainer = true; base.Name = "FormMain"; this.Text = "整车设故考核系统"; base.WindowState = FormWindowState.Maximized; base.Load += new EventHandler(this.FrmMain_Load); ((ISupportInitialize)this.panelControl1).EndInit(); this.panelControl1.ResumeLayout(false); ((ISupportInitialize)this.panelControl5).EndInit(); this.panelControl5.ResumeLayout(false); this.panelControl5.PerformLayout(); ((ISupportInitialize)this.panelControl3).EndInit(); this.panelControl3.ResumeLayout(false); this.panelControl3.PerformLayout(); ((ISupportInitialize)this.ribbonControl1).EndInit(); ((ISupportInitialize)this.repositoryItemPictureEdit1).EndInit(); ((ISupportInitialize)this.repositoryItemPictureEdit2).EndInit(); ((ISupportInitialize)this.repositoryItemPictureEdit3).EndInit(); ((ISupportInitialize)this.repositoryItemPictureEdit4).EndInit(); ((ISupportInitialize)this.panelControl6).EndInit(); this.panelControl6.ResumeLayout(false); ((ISupportInitialize)this.panelControl2).EndInit(); this.panelControl2.ResumeLayout(false); ((ISupportInitialize)this.pictureEdit9.Properties).EndInit(); ((ISupportInitialize)this.panelControl4).EndInit(); this.panelControl4.ResumeLayout(false); ((ISupportInitialize)this.textEdit1.Properties).EndInit(); ((ISupportInitialize)this.imageCollection1).EndInit(); ((ISupportInitialize)this.navBarControl1).EndInit(); ((ISupportInitialize)this.xtraTabbedMdiManager1).EndInit(); ((ISupportInitialize)this.barManager1).EndInit(); base.ResumeLayout(false); }
private void DesignerForm1() { var propertyList = propertyService.GetAllMaterialProperty(); var text = propertyList[0].GetType().GetProperties(); int Location_y = 10; for (int i = 0; i < propertyList.Count; i++) { var property = propertyList[i]; //if (!property.is_show) continue; if (i % 2 == 0) { // 为第一列 var lbl = new LabelControl(); lbl.Name = "lbl" + property.en_name; lbl.Text = property.cn_name + ":"; lbl.Size = new System.Drawing.Size(60, 15); lbl.Location = new System.Drawing.Point(25, Location_y); this.Controls.Add(lbl); if (property.input_type == "1") { var comboBoxValueList = propertyService.GetComboBoxValueByPropertyId(property.id); var cbo = new ComboBoxEdit(); // 添加下拉框的值 foreach (var boxvalue in comboBoxValueList) { cbo.Properties.Items.Add(boxvalue.Value); } cbo.Name = property.en_name; cbo.Size = new System.Drawing.Size(280, 20); cbo.Location = new System.Drawing.Point(88, Location_y - 4); this.Controls.Add(cbo); } else { var txt = new TextEdit(); txt.Name = "txt" + property.en_name; txt.Size = new System.Drawing.Size(280, 20); txt.Location = new System.Drawing.Point(88, Location_y - 4); this.Controls.Add(txt); } } else { // 为第二列 var lbl = new LabelControl(); lbl.Name = "lbl" + property.en_name; lbl.Text = property.cn_name + ":"; lbl.Size = new System.Drawing.Size(60, 15); lbl.Location = new System.Drawing.Point(412, Location_y); this.Controls.Add(lbl); if (property.input_type == "1") { var comboBoxValueList = propertyService.GetComboBoxValueByPropertyId(property.id); var cbo = new ComboBoxEdit(); // 添加下拉框的值 foreach (var boxvalue in comboBoxValueList) { cbo.Properties.Items.Add(boxvalue.Value); } cbo.Name = property.en_name; cbo.Size = new System.Drawing.Size(280, 20); cbo.Location = new System.Drawing.Point(88, Location_y - 4); this.Controls.Add(cbo); } else { var txt = new TextEdit(); txt.Name = "txt" + property.en_name; txt.Size = new System.Drawing.Size(264, 20); txt.Location = new System.Drawing.Point(480, Location_y - 4); this.Controls.Add(txt); } Location_y = Location_y + 30; } } }
/// <summary> /// Returns a sequence of suggestions on how deprecated syntax can be updated based on the generated diagnostics, /// and given the file for which those diagnostics were generated. /// Returns an empty enumerable if any of the given arguments is null. /// </summary> internal static IEnumerable <(string, WorkspaceEdit)> SuggestionsForDeprecatedSyntax (this FileContentManager file, IEnumerable <Diagnostic> diagnostics) { if (file == null || diagnostics == null) { return(Enumerable.Empty <(string, WorkspaceEdit)>()); } var deprecatedUnitTypes = diagnostics.Where(DiagnosticTools.WarningType(WarningCode.DeprecatedUnitType)); var deprecatedNOToperators = diagnostics.Where(DiagnosticTools.WarningType(WarningCode.DeprecatedNOToperator)); var deprecatedANDoperators = diagnostics.Where(DiagnosticTools.WarningType(WarningCode.DeprecatedANDoperator)); var deprecatedORoperators = diagnostics.Where(DiagnosticTools.WarningType(WarningCode.DeprecatedORoperator)); var deprecatedOpCharacteristics = diagnostics.Where(DiagnosticTools.WarningType(WarningCode.DeprecatedOpCharacteristics)); (string, WorkspaceEdit) ReplaceWith(string text, Range range) { bool NeedsWs(Char ch) => Char.IsLetterOrDigit(ch) || ch == '_'; if (range?.Start != null && range.End != null) { var beforeEdit = file.GetLine(range.Start.Line).Text.Substring(0, range.Start.Character); var afterEdit = file.GetLine(range.End.Line).Text.Substring(range.End.Character); if (beforeEdit.Any() && NeedsWs(beforeEdit.Last())) { text = $" {text}"; } if (afterEdit.Any() && NeedsWs(afterEdit.First())) { text = $"{text} "; } } var edit = new TextEdit { Range = range?.Copy(), NewText = text }; return($"Replace with \"{text.Trim()}\".", file.GetWorkspaceEdit(edit)); } // update deprecated keywords and operators var suggestionsForUnitType = deprecatedUnitTypes.Select(d => ReplaceWith(Keywords.qsUnit.id, d.Range)); var suggestionsForNOT = deprecatedNOToperators.Select(d => ReplaceWith(Keywords.qsNOTop.op, d.Range)); var suggestionsForAND = deprecatedANDoperators.Select(d => ReplaceWith(Keywords.qsANDop.op, d.Range)); var suggestionsForOR = deprecatedORoperators.Select(d => ReplaceWith(Keywords.qsORop.op, d.Range)); // update deprecated operation characteristics syntax var typeToQs = new ExpressionTypeToQs(new ExpressionToQs()); string CharacteristicsAnnotation(Characteristics c) { typeToQs.onCharacteristicsExpression(SymbolResolution.ResolveCharacteristics(c)); return($"{Keywords.qsCharacteristics.id} {typeToQs.Output}"); } var suggestionsForOpCharacteristics = deprecatedOpCharacteristics.SelectMany(d => { // TODO: TryGetQsSymbolInfo currently only returns information about the inner most leafs rather than all types etc. // Once it returns indeed all types in the fragment, the following code block should be replaced by the commented out code below. var fragment = file.TryGetFragmentAt(d.Range.Start, out var _); IEnumerable <Characteristics> GetCharacteristics(QsTuple <Tuple <QsSymbol, QsType> > argTuple) => SyntaxGenerator.ExtractItems(argTuple).SelectMany(item => item.Item2.ExtractCharacteristics()).Distinct(); var characteristicsInFragment = fragment?.Kind is QsFragmentKind.FunctionDeclaration function ? GetCharacteristics(function.Item2.Argument) : fragment?.Kind is QsFragmentKind.OperationDeclaration operation ? GetCharacteristics(operation.Item2.Argument) : fragment?.Kind is QsFragmentKind.TypeDefinition type ? GetCharacteristics(type.Item2) : Enumerable.Empty <Characteristics>(); //var symbolInfo = file.TryGetQsSymbolInfo(d.Range.Start, false, out var fragment); //var characteristicsInFragment = (symbolInfo?.UsedTypes ?? Enumerable.Empty<QsType>()) // .SelectMany(t => t.ExtractCharacteristics()).Distinct(); var fragmentStart = fragment?.GetRange()?.Start; return(characteristicsInFragment .Where(c => c.Range.IsValue && DiagnosticTools.GetAbsoluteRange(fragmentStart, c.Range.Item).Overlaps(d.Range)) .Select(c => ReplaceWith(CharacteristicsAnnotation(c), d.Range))); }); return(suggestionsForOpCharacteristics.ToArray() .Concat(suggestionsForUnitType) .Concat(suggestionsForNOT) .Concat(suggestionsForAND) .Concat(suggestionsForOR)); }
/// <summary> /// Torna visible ou invisivel /// TextEdit /// TextBox /// RadioGroup /// CheckBox /// ComboBox /// CheckEdit /// ComboEdit /// MemoEdit /// </summary> /// <param name="componentes"></param> /// <param name="action"></param> public static void ShowHideComponentes(Component[] componentes, bool action) { foreach (var comp in componentes) { if (comp != null) { if (comp.GetType() == typeof(TextEdit)) { TextEdit c = comp as TextEdit; c.Visible = action; } else if (comp.GetType() == typeof(TextBox)) { TextBox c = comp as TextBox; c.Visible = action; } else if (comp.GetType() == typeof(Label)) { Label c = comp as Label; c.Visible = action; } else if (comp.GetType() == typeof(RadioGroup)) { RadioGroup c = comp as RadioGroup; c.Visible = action; } else if (comp.GetType() == typeof(GroupControl)) { GroupControl c = comp as GroupControl; c.Visible = action; } else if (comp.GetType() == typeof(Button)) { Button c = comp as Button; c.Visible = action; } else if (comp.GetType() == typeof(SimpleButton)) { SimpleButton c = comp as SimpleButton; c.Visible = action; } else if (comp.GetType() == typeof(CheckBox)) { CheckBox c = comp as CheckBox; c.Visible = action; } else if (comp.GetType() == typeof(CheckEdit)) { CheckEdit c = comp as CheckEdit; c.Visible = action; } else if (comp.GetType() == typeof(System.Windows.Forms.ComboBox)) { System.Windows.Forms.ComboBox c = comp as System.Windows.Forms.ComboBox; c.Visible = action; } else if (comp.GetType() == typeof(ComboBoxEdit)) { ComboBoxEdit c = comp as ComboBoxEdit; c.Visible = action; } else if (comp.GetType() == typeof(DateEdit)) { DateEdit c = comp as DateEdit; c.Visible = action; } else if (comp.GetType() == typeof(DateTimePicker)) { DateTimePicker c = comp as DateTimePicker; c.Visible = action; } else if (comp.GetType() == typeof(MemoEdit)) { MemoEdit c = comp as MemoEdit; c.Visible = action; } } } }
/// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器 /// 修改此方法的内容。 /// </summary> private void InitializeComponent() { this.lblPageInfo = new DevExpress.XtraEditors.LabelControl(); this.txtCurrentPage = new DevExpress.XtraEditors.TextEdit(); this.btnNext = new DevExpress.XtraEditors.SimpleButton(); this.btnFirst = new DevExpress.XtraEditors.SimpleButton(); this.btnPrevious = new DevExpress.XtraEditors.SimpleButton(); this.btnLast = new DevExpress.XtraEditors.SimpleButton(); this.btnExport = new DevExpress.XtraEditors.SimpleButton(); this.btnExportCurrent = new DevExpress.XtraEditors.SimpleButton(); ((System.ComponentModel.ISupportInitialize)(this.txtCurrentPage.Properties)).BeginInit(); this.SuspendLayout(); // // lblPageInfo // this.lblPageInfo.Location = new System.Drawing.Point(28, 10); this.lblPageInfo.Name = "lblPageInfo"; this.lblPageInfo.Size = new System.Drawing.Size(213, 14); this.lblPageInfo.TabIndex = 0; this.lblPageInfo.Text = "共 {0} 条记录,每页 {1} 条,共 {2} 页"; // // txtCurrentPage // this.txtCurrentPage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.txtCurrentPage.EditValue = "1"; this.txtCurrentPage.Location = new System.Drawing.Point(323, 6); this.txtCurrentPage.Name = "txtCurrentPage"; this.txtCurrentPage.Size = new System.Drawing.Size(25, 20); this.txtCurrentPage.TabIndex = 5; this.txtCurrentPage.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtCurrentPage_KeyDown); // // btnNext // this.btnNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnNext.Location = new System.Drawing.Point(351, 6); this.btnNext.Name = "btnNext"; this.btnNext.Size = new System.Drawing.Size(30, 20); this.btnNext.TabIndex = 6; this.btnNext.Text = ">"; this.btnNext.Click += new System.EventHandler(this.btnNext_Click); // // btnFirst // this.btnFirst.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnFirst.Location = new System.Drawing.Point(259, 6); this.btnFirst.Name = "btnFirst"; this.btnFirst.Size = new System.Drawing.Size(30, 20); this.btnFirst.TabIndex = 7; this.btnFirst.Text = "|<"; this.btnFirst.Click += new System.EventHandler(this.btnFirst_Click); // // btnPrevious // this.btnPrevious.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnPrevious.Location = new System.Drawing.Point(291, 6); this.btnPrevious.Name = "btnPrevious"; this.btnPrevious.Size = new System.Drawing.Size(30, 20); this.btnPrevious.TabIndex = 8; this.btnPrevious.Text = "<"; this.btnPrevious.Click += new System.EventHandler(this.btnPrevious_Click); // // btnLast // this.btnLast.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnLast.Location = new System.Drawing.Point(383, 6); this.btnLast.Name = "btnLast"; this.btnLast.Size = new System.Drawing.Size(30, 20); this.btnLast.TabIndex = 9; this.btnLast.Text = ">|"; this.btnLast.Click += new System.EventHandler(this.btnLast_Click); // // btnExport // this.btnExport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnExport.Location = new System.Drawing.Point(507, 4); this.btnExport.Name = "btnExport"; this.btnExport.Size = new System.Drawing.Size(74, 23); this.btnExport.TabIndex = 11; this.btnExport.Text = "导出全部页"; this.btnExport.Click += new System.EventHandler(this.btnExport_Click); // // btnExportCurrent // this.btnExportCurrent.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnExportCurrent.Location = new System.Drawing.Point(427, 4); this.btnExportCurrent.Name = "btnExportCurrent"; this.btnExportCurrent.Size = new System.Drawing.Size(74, 23); this.btnExportCurrent.TabIndex = 10; this.btnExportCurrent.Text = "导出当前页"; this.btnExportCurrent.Click += new System.EventHandler(this.btnExportCurrent_Click); // // Pager // this.Controls.Add(this.btnExport); this.Controls.Add(this.btnExportCurrent); this.Controls.Add(this.btnLast); this.Controls.Add(this.btnPrevious); this.Controls.Add(this.btnFirst); this.Controls.Add(this.btnNext); this.Controls.Add(this.txtCurrentPage); this.Controls.Add(this.lblPageInfo); this.Cursor = System.Windows.Forms.Cursors.Hand; this.Name = "Pager"; this.Size = new System.Drawing.Size(606, 32); ((System.ComponentModel.ISupportInitialize)(this.txtCurrentPage.Properties)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
/// <summary> /// TextEdit /// TextBox /// RadioGroup /// CheckBox /// ComboBox /// CheckEdit /// ComboEdit /// MemoEdit /// Componentes do Windows.Forms sera desativados pois nao possuem o metodo EditValue /// </summary> /// <param name="componentes"></param> /// <param name="action"></param> public static void HabilitarDesabilitar(Component[] componentes, bool action) { foreach (var comp in componentes) { if (comp != null) { if (comp.GetType() == typeof(TextEdit)) { TextEdit c = comp as TextEdit; c.Enabled = action; } else if (comp.GetType() == typeof(TextBox)) { TextBox c = comp as TextBox; c.Enabled = action; } else if (comp.GetType() == typeof(Label)) { Label c = comp as Label; c.Enabled = action; } else if (comp.GetType() == typeof(RadioGroup)) { RadioGroup c = comp as RadioGroup; c.Enabled = action; } else if (comp.GetType() == typeof(GroupControl)) { GroupControl c = comp as GroupControl; c.Enabled = action; } else if (comp.GetType() == typeof(Button)) { Button c = comp as Button; c.Enabled = action; } else if (comp.GetType() == typeof(SimpleButton)) { SimpleButton c = comp as SimpleButton; c.Enabled = action; } else if (comp.GetType() == typeof(CheckBox)) { CheckBox c = comp as CheckBox; c.Enabled = action; } else if (comp.GetType() == typeof(CheckEdit)) { CheckEdit c = comp as CheckEdit; c.Enabled = action; } else if (comp.GetType() == typeof(System.Windows.Forms.ComboBox)) { System.Windows.Forms.ComboBox c = comp as System.Windows.Forms.ComboBox; c.Enabled = action; } else if (comp.GetType() == typeof(ComboBoxEdit)) { ComboBoxEdit c = comp as ComboBoxEdit; c.Enabled = action; } else if (comp.GetType() == typeof(DateEdit)) { DateEdit c = comp as DateEdit; c.Enabled = action; } else if (comp.GetType() == typeof(DateTimePicker)) { DateTimePicker c = comp as DateTimePicker; c.Enabled = action; } else if (comp.GetType() == typeof(TableLayoutPanel)) { var c = comp as TableLayoutPanel; c.Enabled = action; } else if (comp.GetType() == typeof(RibbonControl)) { var c = comp as RibbonControl; c.Enabled = action; } else if (comp.GetType() == typeof(BarButtonItem)) { var c = comp as BarButtonItem; c.Enabled = action; } else if (comp.GetType() == typeof(MemoEdit)) { var c = comp as MemoEdit; c.Enabled = action; } else if (comp.GetType() == typeof(TimeEdit)) { var c = comp as TimeEdit; c.Enabled = action; } else if (comp.GetType() == typeof(RichTextBox)) { var c = comp as RichTextBox; c.Enabled = action; } else if (comp.GetType() == typeof(LabelControl)) { var c = comp as LabelControl; c.Enabled = action; } else if (comp.GetType() == typeof(GroupBox)) { var c = comp as GroupBox; c.Enabled = action; } else { Trace.WriteLine("Tipo de componente a ser desabilitado desconhecido " + comp.GetType()); } } } }
public void FindCharPosition(TextEdit str, int n, bool single_line) { TextEditRow r = new TextEditRow(); int prev_start = 0; int z = str.Length; int i = 0; int first = 0; if (n == z) { if (single_line) { r = str.Handler.LayoutRow(0); y = 0; first_char = 0; length = z; height = r.ymax - r.ymin; x = r.x1; } else { y = 0; x = 0; height = 1; while (i < z) { r = str.Handler.LayoutRow(i); prev_start = i; i += r.num_chars; } first_char = i; length = 0; prev_first = prev_start; } return; } y = 0; for (;;) { r = str.Handler.LayoutRow(i); if (n < i + r.num_chars) { break; } prev_start = i; i += r.num_chars; y += r.baseline_y_delta; } first_char = first = i; length = r.num_chars; height = r.ymax - r.ymin; prev_first = prev_start; x = r.x0; for (i = 0; first + i < n; ++i) { x += 1; } }
private bool InitializeUI() { try { int columnCount = 0; int rowCount = 0; int boxCount = 0; tablePanel = new TableLayoutPanel(); tablePanel.SuspendLayout(); tablePanel.Name = "TablePanelNew"; tablePanel.TabIndex = 0; tablePanel.Font = new System.Drawing.Font("Arial", 9F); tablePanel.Anchor = (AnchorStyles)((AnchorStyles.Top | AnchorStyles.Left) | AnchorStyles.Right); tablePanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Inset; if (dsParam.Tables.Count > 0 && dsParam.Tables[0].Rows.Count > 0) { object maxCountObj = dsParam.Tables[0].Compute("max(PARAM_COUNT)", ""); if (maxCountObj == null || maxCountObj == DBNull.Value) { throw new Exception("请配置需要抽检的电池片数量"); } else { columnCount = Convert.ToInt32(maxCountObj); } rowCount = dsParam.Tables[0].Rows.Count; tablePanel.ColumnCount = columnCount + 1; tablePanel.RowCount = rowCount + 1; tablePanel.Width = 160 * tablePanel.ColumnCount + 24; tablePanel.Height = 25 * tablePanel.RowCount + 10; for (int i = 0; i < tablePanel.ColumnCount; i++) { tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F)); } for (int i = 0; i <= tablePanel.RowCount; i++) { tablePanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F)); } for (int i = 0; i < tablePanel.RowCount; i++) { for (int j = 0; j < tablePanel.ColumnCount; j++) { if (i == 0 && j == 0) { continue; } if (i == 0) { LabelControl lblCtrl = new LabelControl(); lblCtrl.Size = new System.Drawing.Size(24, 17); lblCtrl.Anchor = AnchorStyles.Top; lblCtrl.Appearance.Font = new System.Drawing.Font("Arial", 9F); lblCtrl.Location = new System.Drawing.Point(0, 0); lblCtrl.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003; lblCtrl.LookAndFeel.UseDefaultLookAndFeel = false; lblCtrl.Appearance.Options.UseFont = true; lblCtrl.TabIndex = 0; lblCtrl.Text = j.ToString() + "片"; tablePanel.Controls.Add(lblCtrl, j, i); } else if (j == 0) { LabelControl lblCtrl = new LabelControl(); lblCtrl.Name = "lblParam" + i.ToString("00"); lblCtrl.Size = new System.Drawing.Size(80, 17); lblCtrl.Anchor = AnchorStyles.Top; lblCtrl.Appearance.Font = new System.Drawing.Font("Arial", 9F); lblCtrl.Location = new System.Drawing.Point(0, 0); lblCtrl.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003; lblCtrl.LookAndFeel.UseDefaultLookAndFeel = false; lblCtrl.Appearance.Options.UseFont = true; lblCtrl.TabIndex = 0; lblCtrl.Tag = dsParam.Tables[0].Rows[i - 1][EDC_POINT_PARAMS_FIELDS.FIELD_PARAM_KEY].ToString(); lblCtrl.Text = dsParam.Tables[0].Rows[i - 1][EDC_POINT_PARAMS_FIELDS.FIELD_PARAM_NAME].ToString(); tablePanel.Controls.Add(lblCtrl, j, i); } else { if (j < Convert.ToInt32(dsParam.Tables[0].Rows[i - 1][EDC_POINT_PARAMS_FIELDS.FIELD_PARAM_COUNT]) + 1) { string paramType = dsParam.Tables[0].Rows[i - 1][EDC_POINT_PARAMS_FIELDS.FIELD_PARAM_TYPE].ToString(); if (paramType.Trim().Length == 0) { throw new Exception("参数类型不能为空,请检查抽检规则是否配置参数类型"); } string deviceType = dsParam.Tables[0].Rows[i - 1][BASE_PARAMETER_FIELDS.FIELD_DEVICE_TYPE].ToString(); //edit by rayna 2011-4-28 string dataType = dsParam.Tables[0].Rows[i - 1][BASE_PARAMETER_FIELDS.FIELD_DATA_TYPE].ToString(); if (dataType == string.Empty) { dataType = "6"; } AttributeDataType paramDataType = (AttributeDataType)Convert.ToInt32(dataType); //end TextEdit txtBox = new TextEdit(); boxCount++; ((ISupportInitialize)(txtBox.Properties)).BeginInit(); txtBox.Dock = System.Windows.Forms.DockStyle.Top; txtBox.Location = new System.Drawing.Point(0, 0); txtBox.Name = "txtBox" + i.ToString() + j.ToString(); txtBox.Tag = deviceType + paramType; txtBox.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F); txtBox.Properties.Appearance.Options.UseFont = true; txtBox.Properties.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003; txtBox.Properties.LookAndFeel.UseDefaultLookAndFeel = false; txtBox.Size = new System.Drawing.Size(160, 25); //edit by rayna 2011-4-28 switch (paramDataType) { case AttributeDataType.INTEGER: txtBox.Properties.Mask.EditMask = "-?\\d+"; break; case AttributeDataType.FLOAT: txtBox.Properties.Mask.EditMask = "(-?\\d+)(\\.\\d+)?"; break; //case AttributeDataType.STRING: // break; default: txtBox.Properties.Mask.EditMask = ".+"; break; } txtBox.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.RegEx; txtBox.Properties.Mask.ShowPlaceHolders = false; //end if (dsParam.Tables[0].Rows[i - 1][BASE_PARAMETER_FIELDS.FIELD_DEVICE_TYPE].ToString() != _edcData.DataType || paramType == "R" || paramType == "C") { txtBox.Properties.ReadOnly = true; } txtBox.TabIndex = boxCount; ((ISupportInitialize)(txtBox.Properties)).EndInit(); tablePanel.Controls.Add(txtBox, j, i); if (dsParam.Tables[0].Rows[i - 1][BASE_PARAMETER_FIELDS.FIELD_DEVICE_TYPE].ToString() == _edcData.DataType && dsParam.Tables[0].Rows[i - 1][EDC_POINT_PARAMS_FIELDS.FIELD_PARAM_TYPE].ToString() == "W") { txtBox.Properties.ReadOnly = !allowInput; txtBox.BackColor = Color.White; _edcData.SampQty = Convert.ToInt32(dsParam.Tables[0].Rows[i - 1][EDC_POINT_PARAMS_FIELDS.FIELD_PARAM_COUNT]); NeedWriteH = i; txtBox.TextChanged += (s, e) => { TextEdit txtEdit = s as TextEdit; if (txtEdit.Text != string.Empty) { CheckValidate(txtEdit); CalculateData(txtEdit); } }; } } } } } tablePanel.ResumeLayout(false); tablePanel.PerformLayout(); this.pcParams.Controls.Add(tablePanel); } } catch (Exception ex) { MessageService.ShowError(ex.Message); return(false); } return(true); }
public override bool TryResolveInsertion(Position position, FormattingContext context, out TextEdit edit, out InsertTextFormat format) { Called = true; edit = ResolvedTextEdit; format = default; return(_canResolve); }
private void btSubmit_Click(object sender, EventArgs e) { //if (THreadGet) //{ // MessageService.ShowMessage("数据接收中......"); // return; //} string isHold = "false"; DataTable saveTable = _edcData.BuildTable(EDC_COLLECTION_DATA_FIELDS.DATABASE_TABLE_NAME); int saveRowCount = 0; for (int i = 1; i < tablePanel.RowCount; i++) { LabelControl lblCtrl = (LabelControl)tablePanel.Controls.Find("lblParam" + i.ToString("00"), true)[0]; string paramKey = lblCtrl.Tag.ToString(); for (int j = 1; j <= Convert.ToInt32(dsParam.Tables[0].Rows[i - 1][EDC_POINT_PARAMS_FIELDS.FIELD_PARAM_COUNT]); j++) { TextEdit textEdit = tablePanel.Controls.Find("txtBox" + i.ToString() + j.ToString(), true)[0] as TextEdit; if (textEdit.Tag.ToString().Substring(0, 1) == _edcData.DataType) { if (textEdit.Tag.ToString().Substring(1, 1) != "R" && textEdit.Text != string.Empty) { string validFlag = string.Empty; if (textEdit.BackColor == Color.Red) { validFlag = "1"; isHold = "true"; } else { validFlag = "0"; } string result = CheckUpdateOrInsert(paramKey, j.ToString(), textEdit.Text); switch (result) { case "no": break; case "new": saveTable.Rows.Add(saveRowCount); saveTable.Rows[saveRowCount][EDC_COLLECTION_DATA_FIELDS.FIELD_SP_SAMP_SEQ] = "1"; saveTable.Rows[saveRowCount][EDC_COLLECTION_DATA_FIELDS.FIELD_SP_UNIT_SEQ] = j.ToString(); saveTable.Rows[saveRowCount][EDC_COLLECTION_DATA_FIELDS.FIELD_PARAM_KEY] = paramKey; saveTable.Rows[saveRowCount][EDC_COLLECTION_DATA_FIELDS.FIELD_PARAM_VALUE] = textEdit.Text; saveTable.Rows[saveRowCount][EDC_COLLECTION_DATA_FIELDS.FIELD_EDC_INS_KEY] = edcInsKey; saveTable.Rows[saveRowCount][EDC_COLLECTION_DATA_FIELDS.FIELD_COL_KEY] = string.Empty; saveTable.Rows[saveRowCount][EDC_COLLECTION_DATA_FIELDS.FIELD_VALID_FLAG] = validFlag; saveTable.Rows[saveRowCount][COMMON_FIELDS.FIELD_COMMON_OPERATION_ACTION] = "New"; saveRowCount++; break; case "update": break; default: break; } } } } } LotEDCEntity edcEntity = new LotEDCEntity(); DataSet dsSave = new DataSet(); if (saveTable.Rows.Count > 0) { dsSave.Tables.Add(saveTable); } string question = string.Empty; if (isHold == "false") { question = "确定要提交数据吗?"; } else { question = "数据超出范围,批次将被锁定。确定要保存数据吗?"; } if (MessageService.AskQuestionSpecifyNoButton(question)) { this.btSubmit.Enabled = false; int RCount = GetRecord(); edcEntity.Operator = _edcData.StaffNumber; edcEntity.SaveEDCPause(dsSave, RCount, lotKey, edcInsKey, isHold); if (edcEntity.ErrorMsg == "") { BindInitialData(); _edcData.UpdateSHRDataToSqlServer(shrTable_Q); MessageService.ShowMessage("保存成功。"); } else { MessageService.ShowError(edcEntity.ErrorMsg); } } }
public async Task RazorRangeFormattingAsync_ValidRequest_InvokesLanguageServer() { // Arrange var filePath = "c:/Some/path/to/file.razor"; var uri = new Uri(filePath); var virtualDocument = new CSharpVirtualDocumentSnapshot(new Uri($"{filePath}.g.cs"), TextBuffer.CurrentSnapshot, 1); LSPDocumentSnapshot document = new TestLSPDocumentSnapshot(uri, 1, new[] { virtualDocument }); var documentManager = new Mock <TrackingLSPDocumentManager>(MockBehavior.Strict); documentManager.Setup(manager => manager.TryGetDocument(It.IsAny <Uri>(), out document)) .Returns(true); var expectedEdit = new TextEdit() { NewText = "SomeEdit", Range = new Range() { Start = new Position(), End = new Position() } }; var requestInvoker = new Mock <LSPRequestInvoker>(MockBehavior.Strict); requestInvoker .Setup(r => r.ReinvokeRequestOnServerAsync <DocumentRangeFormattingParams, TextEdit[]>( TextBuffer, It.IsAny <string>(), It.IsAny <string>(), It.IsAny <DocumentRangeFormattingParams>(), It.IsAny <CancellationToken>())) .Returns(Task.FromResult(new ReinvocationResponse <TextEdit[]>("languageClient", new[] { expectedEdit }))); var uIContextManager = new Mock <RazorUIContextManager>(MockBehavior.Strict); var disposable = new Mock <IDisposable>(MockBehavior.Strict); var documentSynchronizer = new Mock <LSPDocumentSynchronizer>(MockBehavior.Strict); var target = new DefaultRazorLanguageServerCustomMessageTarget( documentManager.Object, JoinableTaskContext, requestInvoker.Object, uIContextManager.Object, disposable.Object, EditorSettingsManager, documentSynchronizer.Object); var request = new RazorDocumentRangeFormattingParams() { HostDocumentFilePath = filePath, Kind = RazorLanguageKind.CSharp, ProjectedRange = new Range() { Start = new Position(), End = new Position() }, Options = new FormattingOptions() { TabSize = 4, InsertSpaces = true } }; // Act var result = await target.RazorRangeFormattingAsync(request, CancellationToken.None).ConfigureAwait(false); // Assert Assert.NotNull(result); var edit = Assert.Single(result.Edits); Assert.Equal("SomeEdit", edit.NewText); }
private void InitializeComponent() { this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); this.btn_Loc = new DevExpress.XtraEditors.SimpleButton(); this.te_Y = new DevExpress.XtraEditors.TextEdit(); this.te_X = new DevExpress.XtraEditors.TextEdit(); this.cbe_History = new DevExpress.XtraEditors.ComboBoxEdit(); this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup(); this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem(); ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit(); this.layoutControl1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.te_Y.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.te_X.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.cbe_History.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit(); this.SuspendLayout(); // // layoutControl1 // this.layoutControl1.Controls.Add(this.btn_Loc); this.layoutControl1.Controls.Add(this.te_Y); this.layoutControl1.Controls.Add(this.te_X); this.layoutControl1.Controls.Add(this.cbe_History); this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.layoutControl1.Location = new System.Drawing.Point(0, 0); this.layoutControl1.Name = "layoutControl1"; this.layoutControl1.Root = this.layoutControlGroup1; this.layoutControl1.Size = new System.Drawing.Size(254, 86); this.layoutControl1.TabIndex = 0; this.layoutControl1.Text = "layoutControl1"; // // btn_Loc // this.btn_Loc.Appearance.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btn_Loc.Appearance.Options.UseFont = true; this.btn_Loc.Location = new System.Drawing.Point(2, 54); this.btn_Loc.Name = "btn_Loc"; this.btn_Loc.Size = new System.Drawing.Size(250, 30); this.btn_Loc.StyleController = this.layoutControl1; this.btn_Loc.TabIndex = 7; this.btn_Loc.Text = "定 位"; this.btn_Loc.Click += new System.EventHandler(this.btn_Loc_Click); // // te_Y // this.te_Y.Location = new System.Drawing.Point(146, 28); this.te_Y.Name = "te_Y"; this.te_Y.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; this.te_Y.Size = new System.Drawing.Size(106, 22); this.te_Y.StyleController = this.layoutControl1; this.te_Y.TabIndex = 6; // // te_X // this.te_X.Location = new System.Drawing.Point(18, 28); this.te_X.Name = "te_X"; this.te_X.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; this.te_X.Size = new System.Drawing.Size(107, 22); this.te_X.StyleController = this.layoutControl1; this.te_X.TabIndex = 5; // // cbe_History // this.cbe_History.Location = new System.Drawing.Point(65, 2); this.cbe_History.Name = "cbe_History"; this.cbe_History.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) }); this.cbe_History.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; this.cbe_History.Size = new System.Drawing.Size(187, 22); this.cbe_History.StyleController = this.layoutControl1; this.cbe_History.TabIndex = 4; this.cbe_History.SelectedIndexChanged += new System.EventHandler(this.cbe_History_SelectedIndexChanged); // // layoutControlGroup1 // this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1"; this.layoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; this.layoutControlGroup1.GroupBordersVisible = false; this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { this.layoutControlItem1, this.layoutControlItem2, this.layoutControlItem3, this.layoutControlItem4 }); this.layoutControlGroup1.Location = new System.Drawing.Point(0, 0); this.layoutControlGroup1.Name = "layoutControlGroup1"; this.layoutControlGroup1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); this.layoutControlGroup1.Size = new System.Drawing.Size(254, 86); this.layoutControlGroup1.Text = "layoutControlGroup1"; this.layoutControlGroup1.TextVisible = false; // // layoutControlItem1 // this.layoutControlItem1.Control = this.cbe_History; this.layoutControlItem1.CustomizationFormText = "历史记录:"; this.layoutControlItem1.Location = new System.Drawing.Point(0, 0); this.layoutControlItem1.Name = "layoutControlItem1"; this.layoutControlItem1.Size = new System.Drawing.Size(254, 26); this.layoutControlItem1.Text = "历史记录:"; this.layoutControlItem1.TextSize = new System.Drawing.Size(60, 14); // // layoutControlItem2 // this.layoutControlItem2.Control = this.te_X; this.layoutControlItem2.CustomizationFormText = "X:"; this.layoutControlItem2.Location = new System.Drawing.Point(0, 26); this.layoutControlItem2.Name = "layoutControlItem2"; this.layoutControlItem2.Size = new System.Drawing.Size(127, 26); this.layoutControlItem2.Text = "X:"; this.layoutControlItem2.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize; this.layoutControlItem2.TextSize = new System.Drawing.Size(11, 14); this.layoutControlItem2.TextToControlDistance = 5; // // layoutControlItem3 // this.layoutControlItem3.Control = this.te_Y; this.layoutControlItem3.CustomizationFormText = "Y:"; this.layoutControlItem3.Location = new System.Drawing.Point(127, 26); this.layoutControlItem3.Name = "layoutControlItem3"; this.layoutControlItem3.Size = new System.Drawing.Size(127, 26); this.layoutControlItem3.Text = "Y:"; this.layoutControlItem3.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize; this.layoutControlItem3.TextSize = new System.Drawing.Size(12, 14); this.layoutControlItem3.TextToControlDistance = 5; // // layoutControlItem4 // this.layoutControlItem4.Control = this.btn_Loc; this.layoutControlItem4.CustomizationFormText = "layoutControlItem4"; this.layoutControlItem4.Location = new System.Drawing.Point(0, 52); this.layoutControlItem4.Name = "layoutControlItem4"; this.layoutControlItem4.Size = new System.Drawing.Size(254, 34); this.layoutControlItem4.Text = "layoutControlItem4"; this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem4.TextToControlDistance = 0; this.layoutControlItem4.TextVisible = false; // // FormLocByCoordinate2D // this.AcceptButton = this.btn_Loc; this.ClientSize = new System.Drawing.Size(254, 86); this.Controls.Add(this.layoutControl1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.Location = new System.Drawing.Point(5, 180); this.Name = "FormLocByCoordinate2D"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "坐标定位"; this.TopMost = true; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormLocByCoordinate2D_FormClosed); this.Load += new System.EventHandler(this.FormLocByCoordinate2D_Load); ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit(); this.layoutControl1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.te_Y.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.te_X.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.cbe_History.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit(); this.ResumeLayout(false); }
private void Set_txtLengColumn4(object sender, EventArgs e, TextEdit tb) { Changed?.Invoke(sender, e); }
private void InitializeComponent() { ComponentResourceManager manager = new ComponentResourceManager(typeof(едакторФормул)); this.layoutControl1 = new LayoutControl(); this.ВыборОтчетнойФормы = new GridLookUpEdit(); this.gridLookUpEdit1View = new GridView(); this.gridColumn_Код = new GridColumn(); this.gridColumn_Идентификатор = new GridColumn(); this.gridColumn_Наименование = new GridColumn(); this.gridColumn_НачалоДействия = new GridColumn(); this.gridColumn_ОкончаниеДействия = new GridColumn(); this.simpleButton_Cancel = new SimpleButton(); this.simpleButton_Ok = new SimpleButton(); this.textEditФормула = new TextEdit(); this.tabТаблицы = new XtraTabControl(); this.layoutControlGroup1 = new LayoutControlGroup(); this.layoutControlItem2 = new LayoutControlItem(); this.layoutControlItem3 = new LayoutControlItem(); this.emptySpaceItem1 = new EmptySpaceItem(); this.emptySpaceItem2 = new EmptySpaceItem(); this.layoutControlItem4 = new LayoutControlItem(); this.layoutControlItem5 = new LayoutControlItem(); this.layoutControlItem1 = new LayoutControlItem(); this.layoutControl1.BeginInit(); this.layoutControl1.SuspendLayout(); this.ВыборОтчетнойФормы.Properties.BeginInit(); this.gridLookUpEdit1View.BeginInit(); this.textEditФормула.Properties.BeginInit(); this.tabТаблицы.BeginInit(); this.layoutControlGroup1.BeginInit(); this.layoutControlItem2.BeginInit(); this.layoutControlItem3.BeginInit(); this.emptySpaceItem1.BeginInit(); this.emptySpaceItem2.BeginInit(); this.layoutControlItem4.BeginInit(); this.layoutControlItem5.BeginInit(); this.layoutControlItem1.BeginInit(); base.SuspendLayout(); this.layoutControl1.Controls.Add(this.ВыборОтчетнойФормы); this.layoutControl1.Controls.Add(this.simpleButton_Cancel); this.layoutControl1.Controls.Add(this.simpleButton_Ok); this.layoutControl1.Controls.Add(this.textEditФормула); this.layoutControl1.Controls.Add(this.tabТаблицы); this.layoutControl1.Dock = DockStyle.Fill; this.layoutControl1.Location = new Point(0, 0); this.layoutControl1.Name = "layoutControl1"; this.layoutControl1.Root = this.layoutControlGroup1; this.layoutControl1.Size = new Size(0x282, 0x1e4); this.layoutControl1.TabIndex = 0; this.layoutControl1.Text = "layoutControl1"; this.layoutControl1.KeyUp += new KeyEventHandler(this.MainView_KeyUp); this.layoutControl1.KeyDown += new KeyEventHandler(this.MainView_KeyDown); this.ВыборОтчетнойФормы.Location = new Point(0x61, 7); this.ВыборОтчетнойФормы.Name = "ВыборОтчетнойФормы"; this.ВыборОтчетнойФормы.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) }); this.ВыборОтчетнойФормы.Properties.NullText = ""; this.ВыборОтчетнойФормы.Properties.PopupFormMinSize = new Size(600, 0); this.ВыборОтчетнойФормы.Properties.View = this.gridLookUpEdit1View; this.ВыборОтчетнойФормы.Size = new Size(0xdb, 20); this.ВыборОтчетнойФормы.StyleController = this.layoutControl1; this.ВыборОтчетнойФормы.TabIndex = 9; this.ВыборОтчетнойФормы.EditValueChanged += new EventHandler(this.ВыборОтчетнойФормы_EditValueChanged); this.ВыборОтчетнойФормы.KeyUp += new KeyEventHandler(this.MainView_KeyUp); this.ВыборОтчетнойФормы.KeyDown += new KeyEventHandler(this.MainView_KeyDown); this.gridLookUpEdit1View.Columns.AddRange(new GridColumn[] { this.gridColumn_Код, this.gridColumn_Идентификатор, this.gridColumn_Наименование, this.gridColumn_НачалоДействия, this.gridColumn_ОкончаниеДействия }); this.gridLookUpEdit1View.FocusRectStyle = DrawFocusRectStyle.RowFocus; this.gridLookUpEdit1View.Name = "gridLookUpEdit1View"; this.gridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false; this.gridLookUpEdit1View.OptionsView.ShowGroupPanel = false; this.gridLookUpEdit1View.OptionsView.ShowIndicator = false; this.gridLookUpEdit1View.KeyDown += new KeyEventHandler(this.MainView_KeyDown); this.gridLookUpEdit1View.KeyUp += new KeyEventHandler(this.MainView_KeyUp); this.gridColumn_Код.Caption = "Код формы"; this.gridColumn_Код.FieldName = "КодФормы"; this.gridColumn_Код.Name = "gridColumn_Код"; this.gridColumn_Код.Visible = true; this.gridColumn_Код.VisibleIndex = 0; this.gridColumn_Код.Width = 0x3a; this.gridColumn_Идентификатор.Caption = "Идентификатор"; this.gridColumn_Идентификатор.FieldName = "Идентификатор"; this.gridColumn_Идентификатор.Name = "gridColumn_Идентификатор"; this.gridColumn_Идентификатор.Visible = true; this.gridColumn_Идентификатор.VisibleIndex = 1; this.gridColumn_Идентификатор.Width = 0x3a; this.gridColumn_Наименование.Caption = "Наименование"; this.gridColumn_Наименование.FieldName = "Наименование"; this.gridColumn_Наименование.Name = "gridColumn_Наименование"; this.gridColumn_Наименование.Visible = true; this.gridColumn_Наименование.VisibleIndex = 2; this.gridColumn_Наименование.Width = 0x4d; this.gridColumn_НачалоДействия.Caption = "Начало действия"; this.gridColumn_НачалоДействия.FieldName = "НачалоДействия"; this.gridColumn_НачалоДействия.Name = "gridColumn_НачалоДействия"; this.gridColumn_НачалоДействия.Visible = true; this.gridColumn_НачалоДействия.VisibleIndex = 3; this.gridColumn_НачалоДействия.Width = 0x7a; this.gridColumn_ОкончаниеДействия.Caption = "Окончание действия"; this.gridColumn_ОкончаниеДействия.FieldName = "ОкончаниеДействия"; this.gridColumn_ОкончаниеДействия.Name = "gridColumn_ОкончаниеДействия"; this.gridColumn_ОкончаниеДействия.Visible = true; this.gridColumn_ОкончаниеДействия.VisibleIndex = 4; this.gridColumn_ОкончаниеДействия.Width = 0x53; this.simpleButton_Cancel.DialogResult = DialogResult.Cancel; this.simpleButton_Cancel.Location = new Point(0x215, 0x1c8); this.simpleButton_Cancel.Name = "simpleButton_Cancel"; this.simpleButton_Cancel.Size = new Size(0x67, 0x16); this.simpleButton_Cancel.StyleController = this.layoutControl1; this.simpleButton_Cancel.TabIndex = 8; this.simpleButton_Cancel.Text = "Отменить"; this.simpleButton_Cancel.KeyUp += new KeyEventHandler(this.MainView_KeyUp); this.simpleButton_Cancel.KeyDown += new KeyEventHandler(this.MainView_KeyDown); this.simpleButton_Ok.DialogResult = DialogResult.OK; this.simpleButton_Ok.Location = new Point(0x1a3, 0x1c8); this.simpleButton_Ok.Name = "simpleButton_Ok"; this.simpleButton_Ok.Size = new Size(0x67, 0x16); this.simpleButton_Ok.StyleController = this.layoutControl1; this.simpleButton_Ok.TabIndex = 7; this.simpleButton_Ok.Text = "Применить"; this.simpleButton_Ok.KeyUp += new KeyEventHandler(this.MainView_KeyUp); this.simpleButton_Ok.KeyDown += new KeyEventHandler(this.MainView_KeyDown); this.textEditФормула.Location = new Point(0x61, 0x26); this.textEditФормула.Name = "textEditФормула"; this.textEditФормула.Size = new Size(0x21b, 20); this.textEditФормула.StyleController = this.layoutControl1; this.textEditФормула.TabIndex = 6; this.textEditФормула.DragDrop += new DragEventHandler(this.textEditФормула_DragDrop); this.textEditФормула.KeyUp += new KeyEventHandler(this.MainView_KeyUp); this.textEditФормула.KeyDown += new KeyEventHandler(this.MainView_KeyDown); this.tabТаблицы.Location = new Point(7, 0x45); this.tabТаблицы.Name = "tabТаблицы"; this.tabТаблицы.Size = new Size(0x275, 0x178); this.tabТаблицы.TabIndex = 5; this.tabТаблицы.KeyUp += new KeyEventHandler(this.MainView_KeyUp); this.tabТаблицы.KeyDown += new KeyEventHandler(this.MainView_KeyDown); this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1"; this.layoutControlGroup1.Items.AddRange(new BaseLayoutItem[] { this.layoutControlItem2, this.layoutControlItem3, this.emptySpaceItem1, this.emptySpaceItem2, this.layoutControlItem4, this.layoutControlItem5, this.layoutControlItem1 }); this.layoutControlGroup1.Location = new Point(0, 0); this.layoutControlGroup1.Name = "layoutControlGroup1"; this.layoutControlGroup1.Size = new Size(0x282, 0x1e4); this.layoutControlGroup1.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); this.layoutControlGroup1.Text = "layoutControlGroup1"; this.layoutControlGroup1.TextVisible = false; this.layoutControlItem2.Control = this.tabТаблицы; this.layoutControlItem2.CustomizationFormText = "layoutControlItem2"; this.layoutControlItem2.Location = new Point(0, 0x3e); this.layoutControlItem2.Name = "layoutControlItem2"; this.layoutControlItem2.Size = new Size(640, 0x183); this.layoutControlItem2.Text = "layoutControlItem2"; this.layoutControlItem2.TextLocation = Locations.Left; this.layoutControlItem2.TextSize = new Size(0, 0); this.layoutControlItem2.TextToControlDistance = 0; this.layoutControlItem2.TextVisible = false; this.layoutControlItem3.Control = this.textEditФормула; this.layoutControlItem3.CustomizationFormText = "Формула"; this.layoutControlItem3.Location = new Point(0, 0x1f); this.layoutControlItem3.Name = "layoutControlItem3"; this.layoutControlItem3.Size = new Size(640, 0x1f); this.layoutControlItem3.Text = "Формула"; this.layoutControlItem3.TextLocation = Locations.Left; this.layoutControlItem3.TextSize = new Size(0x55, 0x19); this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1"; this.emptySpaceItem1.Location = new Point(320, 0); this.emptySpaceItem1.Name = "emptySpaceItem1"; this.emptySpaceItem1.Size = new Size(320, 0x1f); this.emptySpaceItem1.Text = "emptySpaceItem1"; this.emptySpaceItem1.TextSize = new Size(0, 0); this.emptySpaceItem2.CustomizationFormText = "emptySpaceItem2"; this.emptySpaceItem2.Location = new Point(0, 0x1c1); this.emptySpaceItem2.Name = "emptySpaceItem2"; this.emptySpaceItem2.Size = new Size(0x19c, 0x21); this.emptySpaceItem2.Text = "emptySpaceItem2"; this.emptySpaceItem2.TextSize = new Size(0, 0); this.layoutControlItem4.Control = this.simpleButton_Ok; this.layoutControlItem4.CustomizationFormText = "layoutControlItem4"; this.layoutControlItem4.Location = new Point(0x19c, 0x1c1); this.layoutControlItem4.MaxSize = new Size(0x72, 0x21); this.layoutControlItem4.MinSize = new Size(0x72, 0x21); this.layoutControlItem4.Name = "layoutControlItem4"; this.layoutControlItem4.Size = new Size(0x72, 0x21); this.layoutControlItem4.SizeConstraintsType = SizeConstraintsType.Custom; this.layoutControlItem4.Text = "layoutControlItem4"; this.layoutControlItem4.TextLocation = Locations.Left; this.layoutControlItem4.TextSize = new Size(0, 0); this.layoutControlItem4.TextToControlDistance = 0; this.layoutControlItem4.TextVisible = false; this.layoutControlItem5.Control = this.simpleButton_Cancel; this.layoutControlItem5.CustomizationFormText = "layoutControlItem5"; this.layoutControlItem5.Location = new Point(0x20e, 0x1c1); this.layoutControlItem5.MaxSize = new Size(0x72, 0x21); this.layoutControlItem5.MinSize = new Size(0x72, 0x21); this.layoutControlItem5.Name = "layoutControlItem5"; this.layoutControlItem5.Size = new Size(0x72, 0x21); this.layoutControlItem5.SizeConstraintsType = SizeConstraintsType.Custom; this.layoutControlItem5.Text = "layoutControlItem5"; this.layoutControlItem5.TextLocation = Locations.Left; this.layoutControlItem5.TextSize = new Size(0, 0); this.layoutControlItem5.TextToControlDistance = 0; this.layoutControlItem5.TextVisible = false; this.layoutControlItem1.Control = this.ВыборОтчетнойФормы; this.layoutControlItem1.CustomizationFormText = "Отчетная форма"; this.layoutControlItem1.Location = new Point(0, 0); this.layoutControlItem1.MaxSize = new Size(320, 0x1f); this.layoutControlItem1.MinSize = new Size(320, 0x1f); this.layoutControlItem1.Name = "layoutControlItem1"; this.layoutControlItem1.Size = new Size(320, 0x1f); this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom; this.layoutControlItem1.Text = "Отчетная форма"; this.layoutControlItem1.TextLocation = Locations.Left; this.layoutControlItem1.TextSize = new Size(0x55, 20); base.AcceptButton = this.simpleButton_Ok; base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = AutoScaleMode.Font; base.CancelButton = this.simpleButton_Cancel; base.ClientSize = new Size(0x282, 0x1e4); base.Controls.Add(this.layoutControl1); base.Icon = (Icon)manager.GetObject("$this.Icon"); base.Name = "РедакторФормул"; base.StartPosition = FormStartPosition.CenterScreen; this.Text = "Редактор формул"; base.WindowState = FormWindowState.Maximized; base.Load += new EventHandler(this.едакторФормул_Load); base.KeyUp += new KeyEventHandler(this.MainView_KeyUp); base.KeyDown += new KeyEventHandler(this.MainView_KeyDown); this.layoutControl1.EndInit(); this.layoutControl1.ResumeLayout(false); this.ВыборОтчетнойФормы.Properties.EndInit(); this.gridLookUpEdit1View.EndInit(); this.textEditФормула.Properties.EndInit(); this.tabТаблицы.EndInit(); this.layoutControlGroup1.EndInit(); this.layoutControlItem2.EndInit(); this.layoutControlItem3.EndInit(); this.emptySpaceItem1.EndInit(); this.emptySpaceItem2.EndInit(); this.layoutControlItem4.EndInit(); this.layoutControlItem5.EndInit(); this.layoutControlItem1.EndInit(); base.ResumeLayout(false); }
/*kiểm tra điều kiện nhỏ lẻ OKE*/ public bool KiemTraMK(TextEdit txtMK) { string mnv = frmDangNhap.MaNhanVien;/*Mã Nhân Viên ko bh thay đổi lên chọn làm gốc được*/ DataTable dt = DA.TbView(@"Select MaNhanVien,TenNhanVien,DiaChi, SoDienThoai,ChucVu,TenDangNhap,MatKhau,AnhDaiDien,Site From NhanVien Where MaNhanVien='" + mnv + "'"); if (ChangeMD5(txtMK.Text) != dt.Rows[0]["MatKhau"].ToString().Trim()) { XtraMessageBox.Show("Mật khẩu cũ xác nhận không hợp lệ !", "Chú ý !" , MessageBoxButtons.OK, MessageBoxIcon.Error); return true; } return false; }
internal void KeyDownProcess(object sender) { KeyPressEventArgs keyarg; LabelControl btn = (LabelControl)sender; string cmd = Convert.ToString(btn.Tag); string key = btn.Text; switch (cmd) { case "Done": if (this.editControl != null) { if (!string.IsNullOrEmpty(numHour.Text) && !string.IsNullOrEmpty(numMinute.Text) && !string.IsNullOrEmpty(numSecond.Text) ) { if (Convert.ToInt32(numHour.EditValue) == 24) { numHour.EditValue = 0; } DateTime date = new DateTime(1, 1, 1, Convert.ToInt32(numHour.EditValue) , Convert.ToInt32(numMinute.EditValue) , Convert.ToInt32(numSecond.EditValue)); if (this.editControl is DateEdit) { DateEdit tbase = (DateEdit)this.editControl; tbase.EditValue = date; } else if (this.editControl is TextEdit) { TextEdit tbase = (TextEdit)this.editControl; tbase.EditValue = date.ToString("H:mm:ss"); } this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } } break; case "Exit": this.Close(); break; case "Clear": edit.Text = ""; break; case "Back": keyarg = new KeyPressEventArgs('\x8'); edit.SendKey(edit, keyarg); break; default: keyarg = new KeyPressEventArgs(key[0]); edit.SendKey(edit, keyarg); break; } }
/*thực thi các chứng năng tìm kiếm*/ public DataTable TimkiemTheoTen(TextEdit txt1) { if (txt1.Text != "") { return DA.TbView("select * from NhanVien Where TenNhanVien Like N'%" + txt1.Text + "%'"); } else { return DA.TbView("select * from NhanVien"); } }
public static bool DefractionnerObjetReaderClient(OleDbDataReader Objectrecup, PictureEdit PicLice1, PictureEdit PicLice2, PictureEdit PicLice3, TextEdit NomClient, TextEdit CodePostale, TextEdit VilleClient, TextEdit Adresse1, TextEdit Adresse2, RadioGroup GropLicence) { while (Objectrecup.Read()) { NomClient.Text = Objectrecup["ClientPrenom"].ToString(); CodePostale.Text = Objectrecup["ClientCodePostal"].ToString(); VilleClient.Text = Objectrecup["ClientVille"].ToString(); Adresse1.Text = Objectrecup["ClientAdresse1"].ToString(); Adresse2.Text = Objectrecup["ClientAdresse2"].ToString(); if (Objectrecup["TypeLicences"].ToString().Trim() != string.Empty) { GropLicence.SelectedIndex = GropLicence.Properties.Items.IndexOf(GropLicence.Properties.Items.Where(it => it.Description == Objectrecup["TypeLicences"].ToString()).FirstOrDefault()); if (GropLicence.Properties.Items[GropLicence.SelectedIndex].Description == "Licence1") { GropLicence.Properties.Appearance.BackColor = Color.Lime; GropLicence.Properties.AppearanceDisabled.BackColor = Color.Lime; PicLice1.BackColor = Color.Lime; GropLicence.Properties.AppearanceFocused.BackColor = Color.Lime; PicLice2.BackColor = Color.Lime; GropLicence.Properties.AppearanceReadOnly.BackColor = Color.Lime; PicLice3.BackColor = Color.Lime; } else if (GropLicence.Properties.Items[GropLicence.SelectedIndex].Description == "Licence2") { GropLicence.Properties.Appearance.BackColor = Color.Gold; GropLicence.Properties.AppearanceDisabled.BackColor = Color.Gold; PicLice1.BackColor = Color.Gold; GropLicence.Properties.AppearanceFocused.BackColor = Color.Gold; PicLice2.BackColor = Color.Gold; GropLicence.Properties.AppearanceReadOnly.BackColor = Color.Gold; PicLice3.BackColor = Color.Gold; } else if (GropLicence.Properties.Items[GropLicence.SelectedIndex].Description == "Licence3") { GropLicence.Properties.Appearance.BackColor = Color.Aqua; GropLicence.Properties.AppearanceDisabled.BackColor = Color.Aqua; PicLice1.BackColor = Color.Aqua; GropLicence.Properties.AppearanceFocused.BackColor = Color.Aqua; PicLice2.BackColor = Color.Aqua; GropLicence.Properties.AppearanceReadOnly.BackColor = Color.Aqua; PicLice3.BackColor = Color.Aqua; } return(true); } else { GropLicence.Properties.Appearance.BackColor = Color.White; GropLicence.Properties.AppearanceDisabled.BackColor = Color.White; GropLicence.Properties.AppearanceFocused.BackColor = Color.White; GropLicence.Properties.AppearanceReadOnly.BackColor = Color.White; PicLice1.BackColor = Color.White; PicLice2.BackColor = Color.White; PicLice3.BackColor = Color.White; } return(false); } NomClient.Text = string.Empty; CodePostale.Text = string.Empty; VilleClient.Text = string.Empty; Adresse1.Text = string.Empty; Adresse2.Text = string.Empty; GropLicence.Properties.Appearance.BackColor = Color.White; GropLicence.Properties.AppearanceDisabled.BackColor = Color.White; GropLicence.Properties.AppearanceFocused.BackColor = Color.White; GropLicence.Properties.AppearanceReadOnly.BackColor = Color.White; PicLice1.BackColor = Color.White; PicLice2.BackColor = Color.White; PicLice3.BackColor = Color.White; return(false); }
public DataTable TimkiemTheoDC(TextEdit txt3) { if (txt3.Text != "") { return DA.TbView("select * from NhanVien Where DiaChi Like N'%" + txt3.Text + "%'"); } else { return DA.TbView("select * from NhanVien"); } }
/// <summary> /// Methode permet de décortique l'objet reader et d'affecter les resultat au edittext convenable /// </summary> /// <param name="Objectrecup"></param> /// <param name="imputFinLicence"></param> /// <param name="imputDebutLicence"></param> /// <param name="imputNumLicnece"></param> /// <param name="imputTypeLicence"></param> /// <param name="imputJourRestant"></param> /// <param name="ImputNomClient"></param> /// <param name="_PostCode"></param> /// <param name="_JourRestant"></param> public static void DefractionnerObjetReaderDetails(OleDbDataReader Objectrecup, PictureEdit PicLice1, PictureEdit PicLice2, PictureEdit PicLice3, TextEdit imputFinLicence, TextEdit imputDebutLicence, RadioGroup GropLicences, TextEdit imputTypeLicence, TextEdit imputJourRestant, TextEdit ImputNomClient, TextEdit _PostCode, TextEdit _JourRestant) { while (Objectrecup.Read()) { FinLicence = Objectrecup["DateFinLicence"].ToString(); DebutLicence = Objectrecup["DateDebutLicence"].ToString(); NumLicence = Objectrecup["NumLicence"].ToString(); TypeLicence = Objectrecup["TypeLicences"].ToString(); NbreJourLicence = Objectrecup["NbJoursLicence"].ToString(); NomClient = Objectrecup["ClientPrenom"].ToString(); PostCode = Objectrecup["ClientCodePostal"].ToString(); } if (FinLicence.ToString() != string.Empty || FinLicence.ToString() != string.Empty) { DateTime newdateexpiration = Convert.ToDateTime(FinLicence); DateTime newdatedebut = Convert.ToDateTime(DebutLicence); TimeSpan ts = newdateexpiration - newdatedebut; int diff = ts.Days; imputJourRestant.Text = diff.ToString(); imputFinLicence.Text = Convert.ToDateTime(FinLicence).ToString("dd-MM-yyyy"); imputDebutLicence.Text = Convert.ToDateTime(DebutLicence).ToString("dd-MM-yyyy"); } _JourRestant.Text = NbreJourLicence; if (TypeLicence.Trim() != string.Empty) { if (TypeLicence == "Licence1") { GropLicences.SelectedIndex = GropLicences.Properties.Items.IndexOf(GropLicences.Properties.Items.Where(it => it.Description == TypeLicence).FirstOrDefault()); GropLicences.Properties.Appearance.BackColor = Color.Lime; GropLicences.Properties.AppearanceDisabled.BackColor = Color.Lime; PicLice1.BackColor = Color.Lime; GropLicences.Properties.AppearanceFocused.BackColor = Color.Lime; PicLice2.BackColor = Color.Lime; GropLicences.Properties.AppearanceReadOnly.BackColor = Color.Lime; PicLice3.BackColor = Color.Lime; } else if (TypeLicence == "Licence2") { GropLicences.SelectedIndex = GropLicences.Properties.Items.IndexOf(GropLicences.Properties.Items.Where(it => it.Description == TypeLicence).FirstOrDefault()); GropLicences.Properties.Appearance.BackColor = Color.Gold; GropLicences.Properties.AppearanceDisabled.BackColor = Color.Gold; PicLice1.BackColor = Color.Gold; GropLicences.Properties.AppearanceFocused.BackColor = Color.Gold; PicLice2.BackColor = Color.Gold; GropLicences.Properties.AppearanceReadOnly.BackColor = Color.Gold; PicLice3.BackColor = Color.Gold; } else if (TypeLicence == "Licence3") { GropLicences.SelectedIndex = GropLicences.Properties.Items.IndexOf(GropLicences.Properties.Items.Where(it => it.Description == TypeLicence).FirstOrDefault()); GropLicences.Properties.Appearance.BackColor = Color.Aqua; GropLicences.Properties.AppearanceDisabled.BackColor = Color.Aqua; PicLice1.BackColor = Color.Aqua; GropLicences.Properties.AppearanceFocused.BackColor = Color.Aqua; PicLice2.BackColor = Color.Aqua; GropLicences.Properties.AppearanceReadOnly.BackColor = Color.Aqua; PicLice3.BackColor = Color.Aqua; } else { GropLicences.Properties.Appearance.BackColor = Color.White; GropLicences.Properties.AppearanceDisabled.BackColor = Color.White; GropLicences.Properties.AppearanceFocused.BackColor = Color.White; GropLicences.Properties.AppearanceReadOnly.BackColor = Color.White; PicLice1.BackColor = Color.White; PicLice2.BackColor = Color.White; PicLice3.BackColor = Color.White; } } else { GropLicences.Properties.Appearance.BackColor = Color.White; GropLicences.Properties.AppearanceDisabled.BackColor = Color.White; GropLicences.Properties.AppearanceFocused.BackColor = Color.White; GropLicences.Properties.AppearanceReadOnly.BackColor = Color.White; PicLice1.BackColor = Color.White; PicLice2.BackColor = Color.White; PicLice3.BackColor = Color.White; } imputTypeLicence.Text = NumLicence; ImputNomClient.Text = NomClient; _PostCode.Text = PostCode; }