Пример #1
0
		REBARBANDINFO GetBandInfo(int index)
		{
			Control 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.R,
					ColorUtil.VSNetControlColor.G, ColorUtil.VSNetControlColor.B);

				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 | 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;
		}
Пример #2
0
		public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, ref REBARBANDINFO lParam);
Пример #3
0
		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;
		}
Пример #4
0
 public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, ref REBARBANDINFO lParam);