本文整理汇总了C#中System.Windows.Forms.ToolBarButton.GetTBBUTTON方法的典型用法代码示例。如果您正苦于以下问题:C# ToolBarButton.GetTBBUTTON方法的具体用法?C# ToolBarButton.GetTBBUTTON怎么用?C# ToolBarButton.GetTBBUTTON使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ToolBarButton
的用法示例。
在下文中一共展示了ToolBarButton.GetTBBUTTON方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertButton
/// <include file='doc\ToolBar.uex' path='docs/doc[@for="ToolBar.InsertButton"]/*' />
/// <devdoc>
/// <para>Inserts a button at a given location on the toolbar control.</para>
/// </devdoc>
private void InsertButton(int index, ToolBarButton value) {
if (value == null)
throw new ArgumentNullException("value");
if (index < 0 || ((buttons != null) && (index > buttonCount)))
throw new ArgumentOutOfRangeException("index", SR.GetString(SR.InvalidArgument, "index", index.ToString(CultureInfo.CurrentCulture)));
// insert the button into our local array, and then into the
// real windows ToolBar control
//
Insert(index, value);
if (IsHandleCreated) {
NativeMethods.TBBUTTON tbbutton = value.GetTBBUTTON(index);
UnsafeNativeMethods.SendMessage(new HandleRef(this, Handle), NativeMethods.TB_INSERTBUTTON, index, ref tbbutton);
}
UpdateButtons();
}
示例2: InsertButton
private void InsertButton(int index, ToolBarButton value)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
if ((index < 0) || ((this.buttons != null) && (index > this.buttonCount)))
{
throw new ArgumentOutOfRangeException("index", System.Windows.Forms.SR.GetString("InvalidArgument", new object[] { "index", index.ToString(CultureInfo.CurrentCulture) }));
}
this.Insert(index, value);
if (base.IsHandleCreated)
{
System.Windows.Forms.NativeMethods.TBBUTTON tBBUTTON = value.GetTBBUTTON(index);
System.Windows.Forms.UnsafeNativeMethods.SendMessage(new HandleRef(this, base.Handle), System.Windows.Forms.NativeMethods.TB_INSERTBUTTON, index, ref tBBUTTON);
}
this.UpdateButtons();
}