本文整理匯總了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();
}