1. TextEditor (Baredititem) fetching textstringEditValue = BarEditItem1.EditValue.ToString ();//error, return null stringEditValue = ((DevExpress.XtraEditors.TextEdit) baredititem). Editvalue.tostring ();//correct, return text box contents 2. Comboboxedit (Baredititem) Add Itemstringitem ="comboboxItem1"; ((DevExpress.XtraEditors.Repository.RepositoryItemComboBox) This. Baredititem.edit). Items.Add (item); 3. Comboboxedit (Baredititem) fetching textstringItemvalue = This. barEditItem.EditValue.ToString (); 4. Ribbon Controls//Add PageDevExpress.XtraBars.Ribbon.RibbonPage Ribbonpage =NewRibbonpage (); RIBBONCONTROL.PAGES.ADD (Ribbonpage); //Add GroupDevExpress.XtraBars.Ribbon.RibbonPageGroup Ribbonpagegroup =NewRibbonpagegroup (); RIBBONPAGE.GROUPS.ADD (Ribbonpagegroup); //Add buttonDevExpress.XtraBars.BarButtonItem Barbuttonitem =NewBarbuttonitem (); RIBBONPAGEGROUP.ITEMLINKS.ADD (Barbuttonitem); //Add BarsubitemDevExpress.XtraBars.BarSubItem Barsubitem =NewBarsubitem (); RIBBONPAGEGROUP.ITEMLINKS.ADD (Barsubitem); //Add button under BarsubitemBarsubitem.additem (Barbuttonitem); //Strange Removal of page problems while( This. RibbonControl.Pages.Count >0) {ribbonControl.Pages.Remove (ribboncontrol.pages[0]);//Debug Normal, run report exception } while( This. RibbonControl.Pages.Count >0) {Ribboncontrol.selectedpage= ribboncontrol.pages[0]; RibbonControl.Pages.Remove (Ribboncontrol.selectedpage); //operating normally } //prohibit F10 Key TipsRibbonControl.Manager.UseF10KeyForMenu =false; //dx buttonApplicationIcon Property Change Icon Right-click Add Applicationmenu evExpress.XtraBars.Ribbon.ApplicationMenu5. Hitinfo//Right-click event response on the tab page voidXtratabbedmdimanager_event (Objectsender, MouseEventArgs e) { if(E.button = = Mousebuttons.right && Activemdichild! =NULL) {DevExpress.XtraTab.ViewInfo.BaseTabHitInfo hInfo=Xtratabbedmdimanager.calchitinfo (e.location); //Right-click location: on page and not inside the Close button if(Hinfo.isvalid && Hinfo.page! =NULL&&!Hinfo.inpageclosebutton) { This. Popupmenu.showpopup (Control.mouseposition);//pop in the mouse position instead of E. Location } } } //Right-click event Response on the Ribbon Private voidRibboncontrol1_showcustomizationmenu (Objectsender, Ribboncustomizationmenueventargs e) { //disable the original system right-click menuE.showcustomizationmenu =false; //Right-click Position: on Barbuttonitem if(E.hitinfo! =NULL&&E.hitinfo.initem&& E.hitinfo.item.item isBarbuttonitem) { This. Popupmenu.showpopup (control.mouseposition); } //Right-click: on Barbuttonitem in Barsubitem Else if(E.link! =NULL&& E.link.item! =NULL&& E.link.item isBarbuttonitem) { This. Popupmenu.showpopup (control.mouseposition); } } 6. Skin//registering skins after adding skin assembliesDevExpress.UserSkins.OfficeSkins.Register (); DevExpress.UserSkins.BonusSkins.Register (); //Set SkinDevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle ("Liquid Sky");//If the skin name is wrong, press system default settings (first skin)//Galleryfiltermenupopup Event Settings Pop-up Filter menu "All Groups" is Chinese Private voidRgbiskins_galleryfiltermenupopup (Objectsender, Galleryfiltermenueventargs e) {E.filtermenu.itemlinks[n]. Caption="All Skin";//n= Number of groups +1 } //galleryinitdropdowngallery Event Settings Popup Skin list Header "All Groups" for Chinese Private voidRgbiskins_galleryinitdropdowngallery (Objectsender, Inplacegalleryeventargs e) {e.popupgallery.filtercaption="All Skin"; } 7. Dockmanager Save the view's state information to an XML file Dockmanager1.savelayouttoxml (".. Userconfig//viewinfo.xml"); Export saved state information in XML Dockmanager1.restorelayoutfromxml (".. Userconfig//viewinfo.xml"); 8. Barmanager set the bar font and system font BarAndDockingController1.AppearancesBar.ItemsFont=NewFont ( This. Font.fontfamily, currentfontsize); 9. Set the system font DevExpress.Utils.AppearanceObject.DefaultFont=NewFont ( This. Font.fontfamily, currentfontsize); Tenthe. TreeView adds a right-click menu to the tree node and selects the nodePrivate voidTreelist1_mousedown (Objectsender, MouseEventArgs e) { if(E.button = =mousebuttons.right) {DevExpress.XtraTreeList.TreeListHitInfo hi=Treelist1.calchitinfo (e.location); if(Hi. Node! =NULL&& hi. Node.imageindex = =5)//leaf node ImageIndex = = 5{treelistnode node=Treelist1.findnodebyid (hi. Node.id); Treelist1.focusednode=node; This. Popupmenu1.showpopup (mouseposition); } } }
Dev Common settings