private void link_Click(object sender, EventArgs e) { HyperlinkLabelControl linkBanVe = sender as HyperlinkLabelControl; switch (linkBanVe.Name) { case "banVe1": MyGetData(danhSachHoChieu[0].MaHoChieu.ToString()); break; case "banVe2": MyGetData(danhSachHoChieu[1].MaHoChieu.ToString()); break; case "banVe3": MyGetData(danhSachHoChieu[2].MaHoChieu.ToString()); break; case "banVe4": MyGetData(danhSachHoChieu[3].MaHoChieu.ToString()); break; case "banVe5": MyGetData(danhSachHoChieu[4].MaHoChieu.ToString()); break; default: break; } this.Close(); }
/// <summary> /// Creates the control core. /// </summary> /// <returns></returns> protected override object CreateControlCore() { var control = new HyperlinkLabelControl { AllowHtmlString = true, AutoSizeMode = LabelAutoSizeMode.None, }; control.HyperlinkClick += Control_HyperlinkClick; control.Appearance.TextOptions.WordWrap = WordWrap.Wrap; return(control); }
private void InitAccordionControl() { acControl.BeginUpdate(); AccordionControlElement acRootGroupHome = new AccordionControlElement(); AccordionControlElement acItemActivity = new AccordionControlElement(); AccordionControlElement acItemNews = new AccordionControlElement(); AccordionControlElement acRootItemSettings = new AccordionControlElement(); acControl.ElementClick += new ElementClickEventHandler(this.accordionControl1_ElementClick); // // Root Group 'Home' // acRootGroupHome.Elements.AddRange(new AccordionControlElement[] { acItemActivity, acItemNews }); acRootGroupHome.Expanded = true; acRootGroupHome.ImageOptions.ImageUri.Uri = "Home;Office2013"; acRootGroupHome.Name = "acRootGroupHome"; acRootGroupHome.Text = "Home"; // // Child Item 'Activity' // acItemActivity.Name = "acItemActivity"; acItemActivity.Style = ElementStyle.Item; acItemActivity.Tag = "idActivity"; acItemActivity.Text = "Activity"; // // Child Item 'News' // acItemNews.Name = "acItemNews"; acItemNews.Style = ElementStyle.Item; acItemNews.Tag = "idNews"; acItemNews.Text = "News"; // // Root Item 'Settings' with ContentContainer // acRootItemSettings.ImageOptions.ImageUri.Uri = "Customization;Office2013"; acRootItemSettings.Name = "acRootItemSettings"; acRootItemSettings.Style = ElementStyle.Item; acRootItemSettings.Text = "Settings"; // // itemSettingsControlContainer // AccordionContentContainer itemSettingsControlContainer = new AccordionContentContainer(); HyperlinkLabelControl hyperlinkLabelControl1 = new HyperlinkLabelControl(); ToggleSwitch toggleSwitch1 = new ToggleSwitch(); acControl.Controls.Add(itemSettingsControlContainer); acRootItemSettings.ContentContainer = itemSettingsControlContainer; itemSettingsControlContainer.Controls.Add(hyperlinkLabelControl1); itemSettingsControlContainer.Controls.Add(toggleSwitch1); itemSettingsControlContainer.Appearance.BackColor = System.Drawing.SystemColors.Control; itemSettingsControlContainer.Appearance.Options.UseBackColor = true; itemSettingsControlContainer.Height = 60; // // hyperlinkLabelControl1 // hyperlinkLabelControl1.Location = new System.Drawing.Point(26, 33); hyperlinkLabelControl1.Size = new System.Drawing.Size(107, 13); hyperlinkLabelControl1.Text = "www.devexpress.com"; hyperlinkLabelControl1.HyperlinkClick += new DevExpress.Utils.HyperlinkClickEventHandler(this.hyperlinkLabelControl1_HyperlinkClick); // // toggleSwitch1 // toggleSwitch1.EditValue = true; toggleSwitch1.Location = new System.Drawing.Point(24, 3); toggleSwitch1.Properties.AllowFocused = false; toggleSwitch1.Properties.AutoWidth = true; toggleSwitch1.Properties.OffText = "Offline Mode"; toggleSwitch1.Properties.OnText = "Onlne Mode"; toggleSwitch1.Size = new System.Drawing.Size(134, 24); toggleSwitch1.Toggled += new System.EventHandler(this.toggleSwitch1_Toggled); acControl.Elements.AddRange(new DevExpress.XtraBars.Navigation.AccordionControlElement[] { acRootGroupHome, acRootItemSettings }); acRootItemSettings.Expanded = true; acControl.EndUpdate(); }