private void NotifyChildSize(ref Message m) { NMREBARCHILDSIZE size = ( NMREBARCHILDSIZE )m.GetLParam(typeof(NMREBARCHILDSIZE)); if (size.uBand >= 0 && size.uBand < bands.Count) { ToolBarEx toolBar = ( ToolBarEx )bands[(int)size.uBand]; toolBar.ToolbarSizeChanged(size); } /* * for( int i = 0; i < bands.Count; i++ ) * { * // Update toolbar specific information * // This update is to guarantee that the toolbar can resize * // the buttons appropiately in case the SystemMenuFont was * // changed along with the system colors * ToolBarEx toolBar = ( ToolBarEx )bands[i]; * toolBar.ToolbarSizeChanged( size ); * } */ }
protected override void WndProc(ref System.Windows.Forms.Message m) { if (_rebar != null && m.Msg == (int)win32.WM_NOTIFY) { NMHDR Notify = (NMHDR)Marshal.PtrToStructure(m.LParam, typeof(NMHDR)); if (Notify.idFrom == 1) { switch (Notify.code) { case win32.RBN_LAYOUTCHANGED: { //System.Diagnostics.Debug.WriteLine("Layout Changed"); break; } case win32.RBN_AUTOSIZE: { //System.Diagnostics.Debug.WriteLine("Autosized"); break; } case win32.RBN_BEGINDRAG: { //System.Diagnostics.Debug.WriteLine("Begin Drag"); break; } case win32.RBN_ENDDRAG: { //System.Diagnostics.Debug.WriteLine("End Drag"); break; } case win32.RBN_DELETEDBAND: { //System.Diagnostics.Debug.WriteLine("Delete band"); break; } case win32.RBN_DELETINGBAND: { //System.Diagnostics.Debug.WriteLine("Deleting Band"); break; } case win32.RBN_CHILDSIZE: { NMREBARCHILDSIZE ChildSize = (NMREBARCHILDSIZE)Marshal.PtrToStructure(m.LParam, typeof(NMREBARCHILDSIZE)); Form form = this.FindForm(); if (form != null && !form.IsDisposed && form.WindowState == FormWindowState.Minimized) { // 親フォームが最小化された状態の場合,Resizeを送信しない break; } foreach (RebarBand band in _bands) { if (band.ID == ChildSize.wID) { band.OnResize(new EventArgs()); continue; } } //System.Diagnostics.Debug.WriteLine("Child Sized"); break; } case win32.RBN_CHEVRONPUSHED: { this.NotifyChevronPushed(ref m); break; } default: { //System.Diagnostics.Debug.WriteLine("Other Notify code recieved " + Notify.code); break; } } } //System.Diagnostics.Debug.WriteLine("Control WndProc Notified"); } base.WndProc(ref m); }
protected override void WndProc(ref System.Windows.Forms.Message m) { if (_rebar != null && m.Msg == (int)WindowsMessages.WM_NOTIFY) { NMHDR Notify = (NMHDR)Marshal.PtrToStructure(m.LParam, typeof(NMHDR)); if (Notify.idFrom == 1) { switch ((int)Notify.code) { case ((int)WindowsNotifyConstants.RBN_LAYOUTCHANGED): { //System.Diagnostics.Debug.WriteLine("Layout Changed"); break; } case ((int)WindowsNotifyConstants.RBN_AUTOSIZE): { //System.Diagnostics.Debug.WriteLine("Autosized"); break; } case ((int)WindowsNotifyConstants.RBN_BEGINDRAG): { //System.Diagnostics.Debug.WriteLine("Begin Drag"); break; } case ((int)WindowsNotifyConstants.RBN_ENDDRAG): { //System.Diagnostics.Debug.WriteLine("End Drag"); break; } case ((int)WindowsNotifyConstants.RBN_DELETEDBAND): { //System.Diagnostics.Debug.WriteLine("Delete band"); break; } case ((int)WindowsNotifyConstants.RBN_DELETINGBAND): { //System.Diagnostics.Debug.WriteLine("Deleting Band"); break; } case ((int)WindowsNotifyConstants.RBN_CHILDSIZE): { NMREBARCHILDSIZE ChildSize = (NMREBARCHILDSIZE)Marshal.PtrToStructure(m.LParam, typeof(NMREBARCHILDSIZE)); foreach (BandWrapper band in _bands) { if (band.ID == ChildSize.wID) { band.OnResize(new EventArgs()); continue; } } //System.Diagnostics.Debug.WriteLine("Child Sized"); break; } default: { //System.Diagnostics.Debug.WriteLine("Other Notify code recieved " + Notify.code); break; } } } //System.Diagnostics.Debug.WriteLine("Control WndProc Notified"); } base.WndProc(ref m); }