Esempio n. 1
0
 public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, ref REBARBANDINFO lParam);
Esempio n. 2
0
        private REBARBANDINFO GetBandInfo(int index, Control currentBand)
        {
            bool placeHolder = false;
              Control band;
              if ( currentBand != null )
              {
            placeHolder = true;
            band = currentBand;
              }
              else
            band = bands[index];
              REBARBANDINFO rbbi = new REBARBANDINFO();
              rbbi.cbSize = Marshal.SizeOf(typeof(REBARBANDINFO));

              if ( !IsCommonCtrl6() )
              {
            rbbi.fMask = (int)RebarInfoMask.RBBIM_COLORS;
            rbbi.clrBack = (int)ColorUtil.RGB( ColorUtil.VSNetControlColor );
            rbbi.clrFore = (int)ColorUtil.RGB( 255, 0, 255 );
              }

              rbbi.iImage = 0;
              rbbi.hbmBack = IntPtr.Zero;
              rbbi.lParam = 0;
              rbbi.cxHeader = 0;

              rbbi.fMask |= (int)RebarInfoMask.RBBIM_ID;
              rbbi.wID = index;

              if ((band.Text != null) && (band.Text != string.Empty))
              {
            rbbi.fMask |= (int)RebarInfoMask.RBBIM_TEXT;
            rbbi.lpText = Marshal.StringToHGlobalAnsi(band.Text);
            rbbi.cch = (band.Text == null) ? 0 : band.Text.Length;
              }

              rbbi.fMask |= (int)RebarInfoMask.RBBIM_STYLE;
              rbbi.fStyle = (int)(RebarStylesEx.RBBS_CHILDEDGE | RebarStylesEx.RBBS_FIXEDBMP);
              if ( placeHolder == false )
            rbbi.fStyle |= (int)RebarStylesEx.RBBS_GRIPPERALWAYS;

              ToolBarEx tb = (ToolBarEx)band;
              if ( tb.UseNewRow == true)
            rbbi.fStyle |= (int)(RebarStylesEx.RBBS_BREAK);
              rbbi.fStyle |= (band is IChevron) ? (int)RebarStylesEx.RBBS_USECHEVRON : 0;

              rbbi.fMask |= (int)(RebarInfoMask.RBBIM_CHILD);
              rbbi.hwndChild = band.Handle;

              rbbi.fMask |= (int)(RebarInfoMask.RBBIM_CHILDSIZE);
              rbbi.cyMinChild = band.Height;
              rbbi.cxMinChild = 0;
              rbbi.cyChild = 0;
              rbbi.cyMaxChild = 0;
              rbbi.cyIntegral = 0;

              rbbi.fMask |= (int)(RebarInfoMask.RBBIM_SIZE);
              rbbi.cx = band.Width;
              rbbi.fMask |= (int)(RebarInfoMask.RBBIM_IDEALSIZE);
              rbbi.cxIdeal = band.Width;

              return rbbi;
        }
Esempio n. 3
0
 private REBARBANDINFO GetRebarInfo(int index)
 {
     REBARBANDINFO rbbi = new REBARBANDINFO();
       rbbi.cbSize = Marshal.SizeOf(typeof(REBARBANDINFO));
       rbbi.fMask = (int)(RebarInfoMask.RBBIM_ID|RebarInfoMask.RBBIM_IDEALSIZE);
       WindowsAPI.SendMessage(Handle, (int)RebarMessages.RB_GETBANDINFOW, index, ref rbbi);
       return rbbi;
 }
Esempio n. 4
0
 public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, ref REBARBANDINFO lParam);