当前位置: 首页>>代码示例>>C#>>正文


C# BarButtonItem类代码示例

本文整理汇总了C#中BarButtonItem的典型用法代码示例。如果您正苦于以下问题:C# BarButtonItem类的具体用法?C# BarButtonItem怎么用?C# BarButtonItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BarButtonItem类属于命名空间,在下文中一共展示了BarButtonItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DXBarButtonCommandItem

        internal DXBarButtonCommandItem(ControllerCommandTypes Type, BarButtonItem BarButtonItem) 
            : base(Type)
        {
            _barButtonItem = BarButtonItem;

            _barButtonItem.ItemClick += new ItemClickEventHandler(_barButtonItem_ItemClick);
        }
开发者ID:data-avail,项目名称:DataAvail.WinForms,代码行数:7,代码来源:DXBarButtonCommandItem.cs

示例2: AddContextMenu

        /// <summary>
        /// Thêm danh sách menu ngữ cảnh vào trong GridView.
        /// Menu này áp dụng khi click phải trên phần nội dung của lưới
        /// </summary>
        public static void AddContextMenu(GridView grid, List<ItemInfo> items)
        {
            BarManager manager = new BarManager(); ;
            PopupMenu menu = new PopupMenu();

            if (items == null) return;
            for (int i = 0; i < items.Count; i++)
            {
                if (items[i].Per != null)
                    if (ApplyPermissionAction.checkPermission(items[i].Per) == null ||
                       ApplyPermissionAction.checkPermission(items[i].Per) == false)
                    {
                        continue;
                    }

                Image image = ResourceMan.getImage16(items[i].Image);
                BarItem item = new BarButtonItem();
                item.Caption = items[i].Caption;
                item.Name = i.ToString();
                item.Glyph = image;
                manager.Items.Add(item);
                menu.ItemLinks.Add(manager.Items[i]);
                DelegationLib.CallFunction_MulIn_NoOut del = items[i].Delegates;
                item.ItemClick += delegate(object sender, ItemClickEventArgs e)
                {
                    string name = item.Name;
                    List<object> objs = new List<object>();

                    int[] a = grid.GetSelectedRows();
                    DataRow dr = grid.GetDataRow(a[0]);
                    objs.Add(dr);

                    del(objs);
                };
            }

            grid.MouseUp += delegate(object sender, MouseEventArgs e)
            {
                if ((e.Button & MouseButtons.Right) != 0 && grid.GridControl.ClientRectangle.Contains(e.X, e.Y))
                {
                    menu.ShowPopup(manager, Control.MousePosition);
                }
                else
                {
                    menu.HidePopup();
                }
            };

            grid.MouseMove += delegate(object sender, MouseEventArgs e)
            {
                if ((e.Button & MouseButtons.Right) != 0 && grid.GridControl.ClientRectangle.Contains(e.X, e.Y))
                {
                    menu.ShowPopup(manager, Control.MousePosition);
                }
                else
                {
                    menu.HidePopup();
                }
            };
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:64,代码来源:HelpGrid.cs

示例3: FrmChiTietLPSQL

        public FrmChiTietLPSQL()
        {
            InitializeComponent();
            IDField = QL_LICH_PHAT_SONG.LPS_ID;
            DisplayField = QL_LICH_PHAT_SONG.TEN_CT;
            _UsingCheckFiler = false;
            _UseSplitControlEvent = false;
            //_UseParentUpdateEvent = false;
            _UseParentDeleteEvent = false;
            ASCSortClause = "lpsct.ngay_phat_song,lps.gio_phat_song";
            _msgConfirmBeforeDelete = "Bạn có chắc là muốn xóa lịch phát sóng đang chọn?";
            _msgNotifyDeleteFail = "Xóa lịch phát sóng không thành công, vui lòng kiểm tra lại dữ liệu!";

            _fix = new PhieuQuanLy10BandedFix(this);
            AppCtrl.SetAutoHideEmptyBand(gridViewMaster);
            AppCtrl.AddTuyBienCot(barManager1, barSubItemCotHienThi, "Lịch phát sóng", gridViewMaster,
                new GridColumn[] { }, Col_LPS_KenhPhat.Name, Col_LPS_NgayPhat.Name, Col_LPS_GioPhat.Name, Col_LPS_TapSo.Name,
                Col_LPS_ThoiLuong.Name,
                Col_LPS_TenChuongTrinh.Name, Col_LPS_TietMuc.Name, Col_LPS_Category.Name, Col_LPS_ThongTinThem.Name
               );

            BarButtonItemPrintNew = AppCtrl.InitPrintGrid(this, false);
            //AppCtrl.SetTenYear(NamSXTu, NamSXDen);
            AppCtrl.FormatButtonTimKiem(this);
            AppCtrl.AddXemTatCa(this);
            AppCtrl.AddRefresh(this);
            gridViewMaster._SetPermissionElement(BarButtonItemPrintNew, barSubItemExport);
            barButtonItemDelete.ItemClick += barButtonItemDelete_ItemClick;
            splitContainerControl1.SplitterPositionChanged += splitContainerControl1_SplitterPositionChanged;
        }
开发者ID:khanhdtn,项目名称:did-vlib-2011,代码行数:30,代码来源:frmChiTietLPSQL.cs

示例4: AddRefresh

        public static BarButtonItem AddRefresh(PhieuQuanLy10Change frm)
        {
            BarButtonItem resfresh = new BarButtonItem();
            resfresh.Caption = "Làm mới lại các dữ liệu tìm kiếm";
            resfresh.PaintStyle = BarItemPaintStyle.CaptionInMenu;
            resfresh.Glyph = FrameworkParams.imageStore.GetImage2020("view-refresh.png");
            resfresh.Visibility = BarItemVisibility.Always;
            resfresh.Alignment = BarItemLinkAlignment.Right;

            frm.MainBar.LinksPersistInfo.Add(new LinkPersistInfo(resfresh, false));
            frm.barManager1.Items.Add(resfresh);

            resfresh.ItemClick += delegate(object sender, ItemClickEventArgs e)
            {
                try

                {
                    frm.PLLoadFilterPart();

                }
                catch
                {

                }
            };
            return resfresh;
        }
开发者ID:khanhdtn,项目名称:did-vlib-2011,代码行数:27,代码来源:AppCtrl.cs

示例5: FrmChuongTrinhViewQL

        public FrmChuongTrinhViewQL()
        {
            InitializeComponent();
            IDField = CHUONG_TRINH.CT_ID;
            DisplayField = CHUONG_TRINH.NOI_DUNG;
            Alias = "CT.";
            ASCSortClause = "ct.category,ct.noi_dung";
            _UsingCheckFiler = false;
            _msgConfirmBeforeDelete = AppConst.ConfirmDeleteChuongTrinhQL;
            _msgNotifyDeleteFail = AppConst.DeleteFailChuongTrinhQL;
            _UseParentDeleteEvent = false;
            _fix = new PhieuQuanLyBandedFix(this);
            AppCtrl.SetAutoHideEmptyBand(gridViewMaster);

            BarButtonItemPrintNew = AppCtrl.InitPrintGrid(this, false);
            AppCtrl.SetMaskNam(NamSXTu, NamSXDen);
            //AppCtrl.SetTenYear(NamSXTu, NamSXDen);
            AppCtrl.FormatButtonTimKiem(this);
            AppCtrl.AddXemTatCa(this);
            AppCtrl.AddRefresh(this);
            gridViewMaster._SetPermissionElement(BarButtonItemPrintNew, barSubItemExport);

            barButtonItemDelete.ItemClick += barButtonItemDelete_ItemClick;
            Load += frmChuongTrinhViewQL_Load;
        }
开发者ID:khanhdtn,项目名称:did-vlib-2011,代码行数:25,代码来源:frmChuongTrinhViewQL.cs

示例6: UsingHomePage

        public static void UsingHomePage(RibbonControl RibbonCtrl)
        {
            HomePageIDItems = LoadItemIds();
            UpdateHomePage();
            //if (RemoveHomePageItem == null)
            {
                RemoveHomePageItem = new BarButtonItem();
                RemoveHomePageItem.Id = frmRibbonMain.IIII++;
                RemoveHomePageItem.Name = "REMOVE_HOMEPAGE";
                RemoveHomePageItem.Caption = "Loại bỏ khỏi trang Thường dùng";
                RemoveHomePageItem.ItemClick += new ItemClickEventHandler(RemoveHomePageItem_ItemClick);
            }

            //if (AddHomePageItem == null)
            {
                AddHomePageItem = new BarButtonItem();
                AddHomePageItem.Id = frmRibbonMain.IIII++;
                AddHomePageItem.Name = "ADD_HOMEPAGE";
                AddHomePageItem.Caption = "Thêm vào trang Thường dùng";
                AddHomePageItem.ItemClick += new ItemClickEventHandler(AddHomePageItem_ItemClick);
            }
            try { RibbonCtrl.ShowCustomizationMenu -= RibbonCtrl_ShowCustomizationMenu; }
            catch { }
            RibbonCtrl.ShowCustomizationMenu += new RibbonCustomizationMenuEventHandler(RibbonCtrl_ShowCustomizationMenu);
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:25,代码来源:HomePageMenu.cs

示例7: createMenuItems

        private void createMenuItems(BarSubItem barSubItem, string strMenu)
        {
            BarManager barManager1 = ((IMainForm)this.mainForm).GetBarManager();

            if (ds.Tables[0].Select("Parents='" + strMenu + "'").Length > 0)
            {
                BarSubItem subItem = new BarSubItem();
                subItem.Caption = getName(strMenu);
                subItem.Enabled = getEnable(strMenu);
                barSubItem.LinksPersistInfo.Add(new LinkPersistInfo(subItem, getSep(strMenu)));
                barManager1.Items.Add(subItem);
                foreach (DataRow drTemp1 in ds.Tables[0].Select("Parents='" + strMenu + "'"))
                {
                    createMenuItems(subItem, drTemp1[0].ToString());
                }
            }
            else
            {
                BarButtonItem staticItem = new BarButtonItem();
                staticItem.Name = strMenu;
                staticItem.Caption = getName(strMenu);
                staticItem.Enabled = getEnable(strMenu);
                staticItem.PaintStyle = BarItemPaintStyle.CaptionGlyph;
                try{
                    Image image = ResourceMan.getImage16(getImageName(strMenu));
                    staticItem.Glyph = image;
                }
                catch{ }

                staticItem.ItemClick += new ItemClickEventHandler(itemClick);
                barSubItem.LinksPersistInfo.Add(new LinkPersistInfo(staticItem, base.getSep(strMenu)));
                barManager1.Items.Add(staticItem);
            }
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:34,代码来源:MainMenu.cs

示例8: frmKeHoachLPSQL

        public frmKeHoachLPSQL()
        {
            InitializeComponent();
            IDField = KE_HOACH_LPS.KHLPS_ID;
            DisplayField = KE_HOACH_LPS.MA_KHLPS;
            _UseParentDeleteEvent = false;
            this.DESCSortClause = KE_HOACH_LPS.NGAY_LAP;
            this._UseSplitControlEvent = false;
            fix = new PhieuQuanLy10Fix(this);
            fix.splitPanelVisibility = SplitPanelVisibility.Both;
            barButtonPerViewNote = new BarButtonItem();
            barButtonPerViewNote.Visibility = BarItemVisibility.Always;
            barButtonItemPrintNew= AppCtrl.InitPrintGrid(this, true);
            AppCtrl.FormatButtonTimKiem(this);
            AppCtrl.AddXemTatCa(this);

            AppCtrl.AddRefresh(this);
            gridViewMaster._SetPermissionElement(barButtonItemPrintNew, barSubItemExport);
            _msgConfirmBeforeDelete = "Bạn có muốn 'Xóa' kế hoạch phát sóng đang chọn?";
            _msgNotifyDeleteFail = "Thao tác 'Xóa' kế hoạch phát sóng \"{0}\" thực hiện không thành công. Vui lòng kiểm tra lại dữ liệu.";
            gridViewMaster.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(gridViewMaster_FocusedRowChanged);
            gridViewMaster.RowCountChanged += new EventHandler(gridViewMaster_RowCountChanged);

            splitContainerControl1.SplitterPosition = 3 * splitContainerControl1.Width / 5;
            barButtonItemDelete.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(barButtonItemDelete_ItemClick);
        }
开发者ID:khanhdtn,项目名称:did-vlib-2011,代码行数:26,代码来源:frmKeHoachLPSQL.cs

示例9: NavigationInitialize

        void NavigationInitialize() {
            //foreach (NavBarItemLink link in nbgModules.ItemLinks)
            //{
            //    BarButtonItem item = new BarButtonItem(ribbonControl1.Manager, link.Item.Caption);
            //    item.Tag = link;
            //    item.Glyph = link.Item.SmallImage;
            //    item.ItemClick += new ItemClickEventHandler(item_ItemClick);
            //    bsiNavigation.ItemLinks.Add(item);
            //}
            foreach (NavBarItemLink link in this.navBarGroup1.ItemLinks)
            {
                BarButtonItem item = new BarButtonItem(ribbonControl1.Manager, link.Item.Caption);
                item.Tag = link;
                item.Glyph = link.Item.SmallImage;
                item.ItemClick += new ItemClickEventHandler(item1_ItemClick);
                bsiNavigation.ItemLinks.Add(item);
            }
            foreach (NavBarItemLink link in this.navBarGroup2.ItemLinks)
            {
                BarButtonItem item = new BarButtonItem(ribbonControl1.Manager, link.Item.Caption);
                item.Tag = link;
                item.Glyph = link.Item.SmallImage;
                item.ItemClick += new ItemClickEventHandler(item2_ItemClick);
                bsiNavigation.ItemLinks.Add(item);
            }

        }
开发者ID:shine8319,项目名称:DLS,代码行数:27,代码来源:frmMain.cs

示例10: SetButtonEnable

 /// <summary>
 ///     [EN]
 ///     Create By: ManhNV1 -Date: 02/22/2016
 /// </summary>
 /// <param name="btnSet">Array Button need SetEnable</param>
 /// <param name="setEnable">Value set</param>
 public static void SetButtonEnable(BarButtonItem[] btnSet, bool setEnable)
 {
     if (btnSet == null) throw new ArgumentNullException("btnSet");
     foreach (var btnItem in btnSet)
     {
         btnItem.Enabled = setEnable;
     }
 }
开发者ID:NguyenManh94,项目名称:CrawlerDataNP,代码行数:14,代码来源:SEDFuncCall.cs

示例11: AddInvoices

 private RibbonPageGroup AddInvoices()
 {
     InvoicesRibbon = new RibbonPageGroup();
     InvoiceButton = new BarButtonItem();
     ConfigInvoicesButton();
     InvoicesRibbon.ItemLinks.Add(InvoiceButton);
     InvoicesRibbon.Name = "InvoiceRibbonPageGroup";
     return InvoicesRibbon;
 }
开发者ID:PhillipKemp,项目名称:SolutionManager,代码行数:9,代码来源:MainViewModel.cs

示例12: AddAccountPayments

 private RibbonPageGroup AddAccountPayments()
 {
     AccountPaymentsRibbon = new RibbonPageGroup();
     AccountPaymentsButton = new BarButtonItem();
     ConfigAccountPaymentsButton();
     AccountPaymentsRibbon.ItemLinks.Add(AccountPaymentsButton);
     AccountPaymentsRibbon.Name = "AccountPaymentRibbonPageGroup";
     return AccountPaymentsRibbon;
 }
开发者ID:PhillipKemp,项目名称:SolutionManager,代码行数:9,代码来源:MainViewModel.cs

示例13: AddCustomerInvoiceMenu

 private RibbonPageGroup AddCustomerInvoiceMenu()
 {
     CustomerInvoiceRibbon = new RibbonPageGroup();
     CustomerInvoiceButton = new BarButtonItem();
     ConfigCustomerInvoiceButton();
     CustomerInvoiceRibbon.ItemLinks.Add(CustomerInvoiceButton);
     CustomerInvoiceRibbon.Name = "CustomerInvoicesRibbonPageGroup";
     return CustomerInvoiceRibbon;
 }
开发者ID:PhillipKemp,项目名称:SolutionManager,代码行数:9,代码来源:MainViewModel.cs

示例14: addBarButtonItem

        public static BarButtonItem addBarButtonItem(BarManager man, PopupMenu menu, String title)
        {
            BarButtonItem barItem = new BarButtonItem(man, title);
            barItem.Name = "barButtonItem";
            barItem.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
            menu.LinksPersistInfo.Add(new DevExpress.XtraBars.LinkPersistInfo(barItem));

            return barItem;
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:9,代码来源:HelpControl.cs

示例15: DevBarButtonInfo

 public DevBarButtonInfo(BarManager barManager, string name, string caption, Image image, OnButtonClick clickEvent)
 {
     _btn = new BarButtonItem(barManager, caption);
     _btn.Glyph = image;
     _btn.PaintStyle = BarItemPaintStyle.CaptionGlyph;
     _btn.Name = name;
     _clickEvent = clickEvent;
     _btn.ItemClick += new ItemClickEventHandler(OnBarItemClick);
 }
开发者ID:wuhuayun,项目名称:JieLi_Cord,代码行数:9,代码来源:ToolbarButtons.cs


注:本文中的BarButtonItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。