本文整理汇总了C#中DevComponents.DotNetBar.ButtonItem.SetParent方法的典型用法代码示例。如果您正苦于以下问题:C# ButtonItem.SetParent方法的具体用法?C# ButtonItem.SetParent怎么用?C# ButtonItem.SetParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevComponents.DotNetBar.ButtonItem
的用法示例。
在下文中一共展示了ButtonItem.SetParent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateButtons
private void CreateButtons()
{
m_ScrollUp = new ButtonItem("sysgalleryscrollup");
m_ScrollUp.Text = "<expand direction=\"top\"/>";
m_ScrollUp.Style = this.Style;
m_ScrollUp.ColorTable = eButtonColor.OrangeWithBackground;
m_ScrollUp.SetParent(this);
m_ScrollUp.Click += new EventHandler(ScrollUp_Click);
m_ScrollUp.ClickAutoRepeat = true;
m_ScrollUp.ClickRepeatInterval = 200;
m_ScrollUp.CanCustomize = false;
m_ScrollUp.AutoCollapseOnClick = false;
m_ScrollDown = new ButtonItem("sysgalleryscrolldown");
m_ScrollDown.Text = "<expand direction=\"bottom\"/>";
m_ScrollDown.Style = this.Style;
m_ScrollDown.ColorTable = eButtonColor.OrangeWithBackground;
m_ScrollDown.SetParent(this);
m_ScrollDown.Click += new EventHandler(ScrollDown_Click);
m_ScrollDown.ClickAutoRepeat = true;
m_ScrollDown.ClickRepeatInterval = 200;
m_ScrollDown.CanCustomize = false;
m_ScrollDown.AutoCollapseOnClick = false;
m_PopupGallery = new ButtonItem("sysgallerypopup");
m_PopupGallery.Text = "<expand direction=\"popup\"/>";
m_PopupGallery.ButtonStyle = eButtonStyle.TextOnlyAlways;
m_PopupGallery.Style = this.Style;
m_PopupGallery.ColorTable = eButtonColor.OrangeWithBackground;
m_PopupGallery.SetParent(this);
m_PopupGallery.Click += new EventHandler(PopupGallery_Click);
m_PopupGallery.CanCustomize = false;
m_PopupGallery.PopupOpen += new DotNetBarManager.PopupOpenEventHandler(PopupGallery_PopupOpen);
m_PopupGallery.PopupShowing += new EventHandler(PopupGallery_PopupShowing);
m_PopupGallery.PopupClose += new EventHandler(PopupGallery_PopupClose);
m_PopupGallery.PopupFinalized += new EventHandler(PopupGallery_PopupFinalized);
}
示例2: CreateConfigureButton
private void CreateConfigureButton(int y, int height)
{
if(!m_ConfigureItemVisible)
return;
if(m_ConfigureItem==null)
{
LocalizationManager lm=new LocalizationManager(this.GetOwner() as IOwnerLocalize);
m_ConfigureItem=new ButtonItem();
m_ConfigureItem.Image=new System.Drawing.Bitmap(typeof(DevComponents.DotNetBar.DotNetBarManager),"SystemImages.NavBarConfigure.png");
m_ConfigureItem.ImageFixedSize = m_ConfigureItem.Image.Size;
m_ConfigureItem.Style=m_Style;
m_ConfigureItem.ShowSubItems=false;
m_ConfigureItem.SetSystemItem(true);
m_ConfigureItem.ContainerState = eContainerState.NavigationPane;
// Add Sub-Items
ButtonItem item;
if(m_ConfigureShowHideVisible)
{
item=new ButtonItem("sysShowMoreButtons");
item.Image=new System.Drawing.Bitmap(typeof(DevComponents.DotNetBar.DotNetBarManager),"SystemImages.NavBarShowMore.png");
item.Text=lm.GetDefaultLocalizedString(LocalizationKeys.NavBarShowMoreButtons);
item.SetSystemItem(true);
item.Click+=new EventHandler(this.OnShowMoreButtonsClick);
m_ConfigureItem.SubItems.Add(item);
item=new ButtonItem("sysShowFewerButtons");
item.Image=new System.Drawing.Bitmap(typeof(DevComponents.DotNetBar.DotNetBarManager),"SystemImages.NavBarShowLess.png");
item.Text=lm.GetDefaultLocalizedString(LocalizationKeys.NavBarShowFewerButtons);
item.SetSystemItem(true);
item.Click+=new EventHandler(this.OnShowFewerButtonsClick);
m_ConfigureItem.SubItems.Add(item);
}
if(m_ConfigureNavOptionsVisible)
{
item=new ButtonItem("sysNavPaneOptions");
item.Text=lm.GetDefaultLocalizedString(LocalizationKeys.NavBarOptions);
item.Click+=new EventHandler(this.OnNavPaneOptionsClick);
item.SetSystemItem(true);
m_ConfigureItem.SubItems.Add(item);
}
if(m_ConfigureAddRemoveVisible)
{
CustomizeItem customize=new CustomizeItem();
customize.Name="sysNavPaneAddRemove";
customize.CustomizeItemVisible=false;
m_ConfigureItem.SubItems.Add(customize);
}
m_ConfigureItem.SetParent(this);
m_ConfigureItem.Click+=new EventHandler(this.ConfigureItemClick);
m_ConfigureItem.ExpandChange+=new EventHandler(this.ConfigureExpandedChanged);
m_ConfigureItem.PopupShowing+=new EventHandler(this.ConfigurePopupShowing);
m_ConfigureItem.PopupSide=ePopupSide.Right;
lm.Dispose();
BarBaseControl ctrl=this.ContainerControl as BarBaseControl;
if(ctrl!=null && ctrl.Font!=null)
m_ConfigureItem.PopupFont=new Font(ctrl.Font,FontStyle.Regular);
else
m_ConfigureItem.PopupFont = SystemFonts.MenuFont;
}
m_ConfigureItem.PopupType=ePopupType.Menu;
m_ConfigureItem.Displayed=true;
m_ConfigureItem.HeightInternal = height;
m_ConfigureItem.RecalcSize();
m_ConfigureItem.LeftInternal=m_Rect.Right-m_ConfigureItem.WidthInternal;
m_ConfigureItem.TopInternal=y;
m_ConfigureItem.HeightInternal=height;
}