Exemplo n.º 1
0
 internal void NativeUpdateButtonAt(MenuBoxItem value, int index)
 {
     value.owner  = this;
     items[index] = value;
     NativeMethods.TBBUTTONINFO btnINFO = value.GetTBBUTTONINFO(index);
     UnsafeNativeMethods.SendMessage(new HandleRef(this, this.Handle), NativeMethods.TB_SETBUTTONINFO, index, ref btnINFO);
 }
Exemplo n.º 2
0
 internal void NativeInsert(MenuBoxItem value, int index)
 {
     if (value == null)
     {
         throw new ArgumentNullException("value");
     }
     if (IsHandleCreated)
     {
         NativeMethods.TBBUTTON tbbutton = value.GetTBBUTTON(index);
         int result = (int)UnsafeNativeMethods.SendMessage(new HandleRef(this, Handle), NativeMethods.TB_INSERTBUTTON, index, ref tbbutton);
         if (result != 1)
         {
             throw new Win32Exception("insert button fault");
         }
         NativeMethods.TBBUTTONINFO tbbuttonINFO = value.GetTBBUTTONINFO(index);
         UnsafeNativeMethods.SendMessage(new HandleRef(this, Handle), NativeMethods.TB_SETBUTTONINFO, index, ref tbbuttonINFO);
     }
 }