2 // ToolStripDropDown.cs
\r
4 // Permission is hereby granted, free of charge, to any person obtaining
\r
5 // a copy of this software and associated documentation files (the
\r
6 // "Software"), to deal in the Software without restriction, including
\r
7 // without limitation the rights to use, copy, modify, merge, publish,
\r
8 // distribute, sublicense, and/or sell copies of the Software, and to
\r
9 // permit persons to whom the Software is furnished to do so, subject to
\r
10 // the following conditions:
\r
12 // The above copyright notice and this permission notice shall be
\r
13 // included in all copies or substantial portions of the Software.
\r
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
16 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
17 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
18 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
\r
19 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
\r
20 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
\r
21 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
23 // Copyright (c) 2006 Jonathan Pobst
\r
26 // Jonathan Pobst (monkey@jpobst.com)
\r
30 using System.Drawing;
\r
31 using System.Runtime.InteropServices;
\r
32 using System.ComponentModel;
\r
34 namespace System.Windows.Forms
\r
36 [ClassInterface (ClassInterfaceType.AutoDispatch)]
\r
38 public class ToolStripDropDown : ToolStrip
\r
40 private bool allow_transparency;
\r
41 private bool auto_close;
\r
42 private bool can_overflow;
\r
43 private bool drop_shadow_enabled = true;
\r
44 private double opacity = 1D;
\r
45 private ToolStripItem owner_item;
\r
47 #region Public Constructor
\r
48 public ToolStripDropDown () : base ()
\r
50 SetStyle (ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
\r
51 SetStyle (ControlStyles.ResizeRedraw, true);
\r
53 this.auto_close = true;
\r
55 this.DefaultDropDownDirection = ToolStripDropDownDirection.Right;
\r
56 this.GripStyle = ToolStripGripStyle.Hidden;
\r
57 this.TopLevel = true;
\r
61 #region Public Properties
\r
63 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
\r
64 public bool AllowTransparency {
\r
65 get { return allow_transparency; }
\r
67 if (value == allow_transparency)
\r
70 if ((XplatUI.SupportsTransparency () & TransparencySupport.Set) != 0) {
\r
71 allow_transparency = value;
\r
73 if (this.IsHandleCreated) {
\r
75 XplatUI.SetWindowTransparency (Handle, Opacity, Color.Empty);
\r
77 UpdateStyles (); // Remove the WS_EX_LAYERED style
\r
84 [EditorBrowsable (EditorBrowsableState.Never)]
\r
85 public override AnchorStyles Anchor {
\r
86 get { return base.Anchor; }
\r
87 set { base.Anchor = value; }
\r
90 [DefaultValue (true)]
\r
91 public bool AutoClose
\r
93 get { return this.auto_close; }
\r
94 set { this.auto_close = value; }
\r
97 [DefaultValue (true)]
\r
98 public override bool AutoSize {
\r
99 get { return base.AutoSize; }
\r
100 set { base.AutoSize = value; }
\r
103 public new bool CanOverflow {
\r
104 get { return this.can_overflow; }
\r
105 set { this.can_overflow = value; }
\r
108 [Browsable (false)]
\r
109 [EditorBrowsable (EditorBrowsableState.Never)]
\r
110 public new ContextMenu ContextMenu {
\r
111 get { return null; }
\r
115 [Browsable (false)]
\r
116 [EditorBrowsable (EditorBrowsableState.Never)]
\r
117 public new ContextMenuStrip ContextMenuStrip {
\r
118 get { return null; }
\r
122 public override ToolStripDropDownDirection DefaultDropDownDirection {
\r
123 get { return base.DefaultDropDownDirection; }
\r
124 set { base.DefaultDropDownDirection = value; }
\r
127 [Browsable (false)]
\r
128 [EditorBrowsable (EditorBrowsableState.Always)]
\r
129 [DefaultValue (DockStyle.None)]
\r
130 public override DockStyle Dock {
\r
131 get { return base.Dock; }
\r
132 set { base.Dock = value; }
\r
135 public bool DropShadowEnabled {
\r
136 get { return this.drop_shadow_enabled; }
\r
138 if (this.drop_shadow_enabled == value)
\r
141 this.drop_shadow_enabled = value;
\r
142 UpdateStyles (); // Re-CreateParams
\r
146 public override Font Font {
\r
147 get { return base.Font; }
\r
148 set { base.Font = value; }
\r
151 [Browsable (false)]
\r
152 [EditorBrowsable (EditorBrowsableState.Never)]
\r
153 public new ToolStripGripDisplayStyle GripDisplayStyle {
\r
154 get { return ToolStripGripDisplayStyle.Vertical; }
\r
157 [Browsable (false)]
\r
158 [EditorBrowsable (EditorBrowsableState.Never)]
\r
159 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
\r
160 public new Padding GripMargin {
\r
161 get { return Padding.Empty; }
\r
165 [Browsable (false)]
\r
166 [EditorBrowsable (EditorBrowsableState.Never)]
\r
167 public new Rectangle GripRectangle {
\r
168 get { return Rectangle.Empty; }
\r
171 [Browsable (false)]
\r
172 [EditorBrowsable (EditorBrowsableState.Never)]
\r
173 [DefaultValue (ToolStripGripStyle.Hidden)]
\r
174 public new ToolStripGripStyle GripStyle {
\r
175 get { return base.GripStyle; }
\r
176 set { base.GripStyle = value; }
\r
179 public bool IsAutoGenerated {
\r
180 get { return this is ToolStripOverflow; }
\r
183 [Browsable (false)]
\r
184 [EditorBrowsable (EditorBrowsableState.Never)]
\r
185 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
\r
186 public new Point Location {
\r
187 get { return base.Location; }
\r
188 set { base.Location = value; }
\r
191 [DefaultValue (1D)]
\r
192 [TypeConverter (typeof (OpacityConverter))]
\r
193 [Browsable (false)]
\r
194 [EditorBrowsable (EditorBrowsableState.Advanced)]
\r
195 public double Opacity {
\r
196 get { return this.opacity; }
\r
198 if (this.opacity == value)
\r
201 this.opacity = value;
\r
202 this.allow_transparency = true;
\r
204 if (this.IsHandleCreated) {
\r
206 XplatUI.SetWindowTransparency (Handle, opacity, Color.Empty);
\r
211 [EditorBrowsable (EditorBrowsableState.Never)]
\r
212 public new ToolStripOverflowButton OverflowButton {
\r
213 get { return base.OverflowButton; }
\r
216 [Browsable (false)]
\r
217 [DefaultValue (null)]
\r
218 public ToolStripItem OwnerItem {
\r
219 get { return this.owner_item; }
\r
220 set { this.owner_item = value;
\r
222 if (this.owner_item != null)
\r
223 if (this.owner_item.Owner != null)
\r
224 this.Renderer = this.owner_item.Owner.Renderer;
\r
228 [Browsable (false)]
\r
229 [EditorBrowsable (EditorBrowsableState.Always)]
\r
230 public new Region Region {
\r
231 get { return base.Region; }
\r
232 set { base.Region = value; }
\r
235 [Localizable (true)]
\r
236 [AmbientValue (RightToLeft.Inherit)]
\r
237 public override RightToLeft RightToLeft {
\r
238 get { return base.RightToLeft; }
\r
239 set { base.RightToLeft = value; }
\r
242 [Browsable (false)]
\r
243 [EditorBrowsable (EditorBrowsableState.Never)]
\r
244 public new bool Stretch {
\r
245 get { return false; }
\r
249 [Browsable (false)]
\r
250 [EditorBrowsable (EditorBrowsableState.Never)]
\r
251 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
\r
252 public new int TabIndex {
\r
257 [Browsable (false)]
\r
258 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
\r
259 [EditorBrowsable (EditorBrowsableState.Advanced)]
\r
260 public bool TopLevel {
\r
261 get { return GetTopLevel (); }
\r
262 set { SetTopLevel (value); }
\r
265 [Browsable (false)]
\r
266 [Localizable (true)]
\r
267 [DefaultValue (false)]
\r
268 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
\r
269 public new bool Visible {
\r
270 get { return base.Visible; }
\r
271 set { base.Visible = value; }
\r
275 #region Protected Properties
\r
276 protected override CreateParams CreateParams {
\r
278 CreateParams cp = base.CreateParams;
\r
280 cp.Style = unchecked ((int)(WindowStyles.WS_POPUP | WindowStyles.WS_CLIPCHILDREN));
\r
281 cp.ClassStyle |= (int)XplatUIWin32.ClassStyle.CS_DROPSHADOW;
\r
282 cp.ExStyle |= (int)(WindowExStyles.WS_EX_TOOLWINDOW | WindowExStyles.WS_EX_TOPMOST);
\r
284 if (Opacity < 1.0 && allow_transparency)
\r
285 cp.ExStyle |= (int)WindowExStyles.WS_EX_LAYERED;
\r
287 cp.ExStyle |= (int) WindowExStyles.WS_EX_TOPMOST;
\r
293 protected override DockStyle DefaultDock {
\r
294 get { return DockStyle.None; }
\r
297 protected override Padding DefaultPadding {
\r
298 get { return new Padding (1, 2, 1, 2); }
\r
301 protected override bool DefaultShowItemToolTips {
\r
302 get { return true; }
\r
305 //protected internal override Size MaxItemSize {
\r
306 // get { return new Size (Screen.PrimaryScreen.Bounds.Width - 2, Screen.PrimaryScreen.Bounds.Height - 34); }
\r
309 protected virtual bool TopMost {
\r
310 get { return true; }
\r
314 #region Public Methods
\r
315 public void Close ()
\r
317 this.Close (ToolStripDropDownCloseReason.CloseCalled);
\r
320 public void Close (ToolStripDropDownCloseReason reason)
\r
322 // Give users a chance to cancel the close
\r
323 ToolStripDropDownClosingEventArgs e = new ToolStripDropDownClosingEventArgs (reason);
\r
324 this.OnClosing (e);
\r
329 // Don't actually close if AutoClose == true unless explicitly called
\r
330 if (!this.auto_close && reason != ToolStripDropDownCloseReason.CloseCalled)
\r
333 // Detach from the tracker
\r
334 ToolStripManager.AppClicked -= new EventHandler (ToolStripMenuTracker_AppClicked); ;
\r
335 ToolStripManager.AppFocusChange -= new EventHandler (ToolStripMenuTracker_AppFocusChange);
\r
337 // Hide this dropdown
\r
340 // Owner MenuItem needs to be told to redraw (it's no longer selected)
\r
341 if (owner_item != null)
\r
342 owner_item.Invalidate ();
\r
344 // Recursive hide all child dropdowns
\r
345 foreach (ToolStripItem tsi in this.Items)
\r
346 if (tsi is ToolStripMenuItem)
\r
347 (tsi as ToolStripMenuItem).HideDropDown (reason);
\r
349 this.OnClosed (new ToolStripDropDownClosedEventArgs (reason));
\r
352 [Browsable (false)]
\r
353 [EditorBrowsable (EditorBrowsableState.Never)]
\r
354 public new void Show ()
\r
356 CancelEventArgs e = new CancelEventArgs ();
\r
357 this.OnOpening (e);
\r
362 // The tracker lets us know when the form is clicked or loses focus
\r
363 ToolStripManager.AppClicked += new EventHandler (ToolStripMenuTracker_AppClicked);
\r
364 ToolStripManager.AppFocusChange += new EventHandler (ToolStripMenuTracker_AppFocusChange);
\r
368 this.OnOpened (EventArgs.Empty);
\r
371 public void Show (Point screenLocation)
\r
373 this.Location = screenLocation;
\r
377 public void Show (Control control, Point position)
\r
379 if (control == null)
\r
380 throw new ArgumentNullException ("control");
\r
382 this.Location = control.PointToScreen (position);
\r
386 public void Show (int x, int y)
\r
388 this.Location = new Point (x, y);
\r
392 public void Show (Point position, ToolStripDropDownDirection direction)
\r
394 this.PerformLayout ();
\r
396 Point show_point = position;
\r
398 switch (direction) {
\r
399 case ToolStripDropDownDirection.AboveLeft:
\r
400 show_point.Y -= this.Height;
\r
401 show_point.X -= this.Width;
\r
403 case ToolStripDropDownDirection.AboveRight:
\r
404 show_point.Y -= this.Height;
\r
406 case ToolStripDropDownDirection.BelowLeft:
\r
407 show_point.X -= this.Width;
\r
409 case ToolStripDropDownDirection.Left:
\r
410 show_point.X -= this.Width;
\r
412 case ToolStripDropDownDirection.Right:
\r
416 if (this.Location != show_point)
\r
417 this.Location = show_point;
\r
422 public void Show (Control control, int x, int y)
\r
424 if (control == null)
\r
425 throw new ArgumentNullException ("control");
\r
427 Show (control, new Point (x, y));
\r
430 public void Show (Control control, Point position, ToolStripDropDownDirection direction)
\r
432 if (control == null)
\r
433 throw new ArgumentNullException ("control");
\r
435 Show (control.PointToScreen (position), direction);
\r
439 #region Protected Methods
\r
440 protected override void CreateHandle ()
\r
442 base.CreateHandle ();
\r
445 protected override LayoutSettings CreateLayoutSettings (ToolStripLayoutStyle style)
\r
447 return base.CreateLayoutSettings (style);
\r
450 protected override void Dispose (bool disposing)
\r
452 base.Dispose (disposing);
\r
455 protected virtual void OnClosed (ToolStripDropDownClosedEventArgs e)
\r
457 ToolStripDropDownClosedEventHandler eh = (ToolStripDropDownClosedEventHandler)(Events [ClosedEvent]);
\r
462 protected virtual void OnClosing (ToolStripDropDownClosingEventArgs e)
\r
464 ToolStripDropDownClosingEventHandler eh = (ToolStripDropDownClosingEventHandler)(Events [ClosingEvent]);
\r
469 protected override void OnHandleCreated (EventArgs e)
\r
471 base.OnHandleCreated (e);
\r
474 protected override void OnItemClicked (ToolStripItemClickedEventArgs e)
\r
476 base.OnItemClicked (e);
\r
479 protected override void OnLayout (LayoutEventArgs e)
\r
481 // Find the widest menu item
\r
484 foreach (ToolStripItem tsi in this.Items) {
\r
485 if (!tsi.Available)
\r
488 tsi.SetPlacement (ToolStripItemPlacement.Main);
\r
490 if (tsi.GetPreferredSize (Size.Empty).Width > widest)
\r
491 widest = tsi.GetPreferredSize (Size.Empty).Width;
\r
494 int x = this.Padding.Left;
\r
495 widest += 68 - this.Padding.Horizontal;
\r
496 int y = this.Padding.Top;
\r
498 foreach (ToolStripItem tsi in this.Items) {
\r
499 if (!tsi.Available)
\r
502 y += tsi.Margin.Top;
\r
506 if (tsi is ToolStripSeparator)
\r
511 tsi.SetBounds (new Rectangle (x, y, widest, height));
\r
512 y += tsi.Height + tsi.Margin.Bottom;
\r
515 this.Size = new Size (widest + this.Padding.Horizontal, y + this.Padding.Bottom);// + 2);
\r
516 this.SetDisplayedItems ();
\r
517 this.OnLayoutCompleted (EventArgs.Empty);
\r
518 this.Invalidate ();
\r
521 protected override void OnMouseUp (MouseEventArgs mea)
\r
523 base.OnMouseUp (mea);
\r
526 protected virtual void OnOpened (EventArgs e)
\r
528 EventHandler eh = (EventHandler)(Events [OpenedEvent]);
\r
533 protected virtual void OnOpening (CancelEventArgs e)
\r
535 CancelEventHandler eh = (CancelEventHandler)(Events [OpeningEvent]);
\r
540 protected override void OnParentChanged (EventArgs e)
\r
542 base.OnParentChanged (e);
\r
544 if (Parent is ToolStrip)
\r
545 this.Renderer = (Parent as ToolStrip).Renderer;
\r
548 protected override void OnVisibleChanged (EventArgs e)
\r
550 base.OnVisibleChanged (e);
\r
553 [EditorBrowsable (EditorBrowsableState.Advanced)]
\r
554 protected override bool ProcessDialogChar (char charCode)
\r
556 return base.ProcessDialogChar (charCode);
\r
559 protected override bool ProcessDialogKey (Keys keyData)
\r
561 return base.ProcessDialogKey (keyData);
\r
564 protected override bool ProcessMnemonic (char charCode)
\r
566 return base.ProcessMnemonic (charCode);
\r
569 [EditorBrowsable (EditorBrowsableState.Never)]
\r
570 protected override void ScaleCore (float dx, float dy)
\r
572 base.ScaleCore (dx, dy);
\r
575 protected override void SetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified)
\r
577 base.SetBoundsCore (x, y, width, height, specified);
\r
580 protected override void SetVisibleCore (bool value)
\r
582 base.SetVisibleCore (value);
\r
585 protected override void WndProc (ref Message m)
\r
587 const int MA_NOACTIVATE = 0x0003;
\r
589 // Don't activate when the WM tells us to
\r
590 if ((Msg)m.Msg == Msg.WM_MOUSEACTIVATE) {
\r
591 m.Result = (IntPtr)MA_NOACTIVATE;
\r
595 base.WndProc (ref m);
\r
599 #region Public Events
\r
600 static object ClosedEvent = new object ();
\r
601 static object ClosingEvent = new object ();
\r
602 static object OpenedEvent = new object ();
\r
603 static object OpeningEvent = new object ();
\r
604 static object ScrollEvent = new object ();
\r
606 [Browsable (false)]
\r
607 public new event EventHandler BackgroundImageChanged {
\r
608 add { base.BackgroundImageChanged += value; }
\r
609 remove { base.BackgroundImageChanged -= value; }
\r
612 [Browsable (false)]
\r
613 public new event EventHandler BackgroundImageLayoutChanged {
\r
614 add { base.BackgroundImageLayoutChanged += value; }
\r
615 remove { base.BackgroundImageLayoutChanged -= value; }
\r
618 [Browsable (false)]
\r
619 public new event EventHandler BindingContextChanged {
\r
620 add { base.BindingContextChanged += value; }
\r
621 remove { base.BindingContextChanged -= value; }
\r
624 [Browsable (false)]
\r
625 [EditorBrowsable (EditorBrowsableState.Always)]
\r
626 public new event UICuesEventHandler ChangeUICues {
\r
627 add { base.ChangeUICues += value; }
\r
628 remove { base.ChangeUICues -= value; }
\r
631 public event ToolStripDropDownClosedEventHandler Closed {
\r
632 add { Events.AddHandler (ClosedEvent, value); }
\r
633 remove { Events.RemoveHandler (ClosedEvent, value); }
\r
636 public event ToolStripDropDownClosingEventHandler Closing {
\r
637 add { Events.AddHandler (ClosingEvent, value); }
\r
638 remove { Events.RemoveHandler (ClosingEvent, value); }
\r
641 [Browsable (false)]
\r
642 [EditorBrowsable (EditorBrowsableState.Never)]
\r
643 public new event EventHandler ContextMenuChanged {
\r
644 add { base.ContextMenuChanged += value; }
\r
645 remove { base.ContextMenuChanged -= value; }
\r
648 [Browsable (false)]
\r
649 [EditorBrowsable (EditorBrowsableState.Always)]
\r
650 public new event EventHandler ContextMenuStripChanged {
\r
651 add { base.ContextMenuStripChanged += value; }
\r
652 remove { base.ContextMenuStripChanged -= value; }
\r
655 [Browsable (false)]
\r
656 [EditorBrowsable (EditorBrowsableState.Always)]
\r
657 public new event EventHandler DockChanged {
\r
658 add { base.DockChanged += value; }
\r
659 remove { base.DockChanged -= value; }
\r
662 [Browsable (false)]
\r
663 [EditorBrowsable (EditorBrowsableState.Always)]
\r
664 public new event EventHandler Enter {
\r
665 add { base.Enter += value; }
\r
666 remove { base.Enter -= value; }
\r
669 [Browsable (false)]
\r
670 [EditorBrowsable (EditorBrowsableState.Always)]
\r
671 public new event EventHandler FontChanged {
\r
672 add { base.FontChanged += value; }
\r
673 remove { base.FontChanged -= value; }
\r
676 [Browsable (false)]
\r
677 [EditorBrowsable (EditorBrowsableState.Never)]
\r
678 public new event EventHandler ForeColorChanged {
\r
679 add { base.ForeColorChanged += value; }
\r
680 remove { base.ForeColorChanged -= value; }
\r
683 [Browsable (false)]
\r
684 [EditorBrowsable (EditorBrowsableState.Never)]
\r
685 public new event GiveFeedbackEventHandler GiveFeedback {
\r
686 add { base.GiveFeedback += value; }
\r
687 remove { base.GiveFeedback -= value; }
\r
690 [Browsable (false)]
\r
691 [EditorBrowsable (EditorBrowsableState.Always)]
\r
692 public new event HelpEventHandler HelpRequested {
\r
693 add { base.HelpRequested += value; }
\r
694 remove { base.HelpRequested -= value; }
\r
697 [Browsable (false)]
\r
698 [EditorBrowsable (EditorBrowsableState.Always)]
\r
699 public new event EventHandler ImeModeChanged {
\r
700 add { base.ImeModeChanged += value; }
\r
701 remove { base.ImeModeChanged -= value; }
\r
704 [Browsable (false)]
\r
705 [EditorBrowsable (EditorBrowsableState.Always)]
\r
706 public new event KeyEventHandler KeyDown {
\r
707 add { base.KeyDown += value; }
\r
708 remove { base.KeyDown -= value; }
\r
711 [Browsable (false)]
\r
712 [EditorBrowsable (EditorBrowsableState.Always)]
\r
713 public new event KeyPressEventHandler KeyPress {
\r
714 add { base.KeyPress += value; }
\r
715 remove { base.KeyPress -= value; }
\r
718 [Browsable (false)]
\r
719 [EditorBrowsable (EditorBrowsableState.Always)]
\r
720 public new event KeyEventHandler KeyUp {
\r
721 add { base.KeyUp += value; }
\r
722 remove { base.KeyUp -= value; }
\r
725 [Browsable (false)]
\r
726 [EditorBrowsable (EditorBrowsableState.Always)]
\r
727 public new event EventHandler Leave {
\r
728 add { base.Leave += value; }
\r
729 remove { base.Leave -= value; }
\r
732 public event EventHandler Opened {
\r
733 add { Events.AddHandler (OpenedEvent, value); }
\r
734 remove { Events.RemoveHandler (OpenedEvent, value); }
\r
737 public event CancelEventHandler Opening {
\r
738 add { Events.AddHandler (OpeningEvent, value); }
\r
739 remove { Events.RemoveHandler (OpeningEvent, value); }
\r
742 [Browsable (false)]
\r
743 [EditorBrowsable (EditorBrowsableState.Always)]
\r
744 public new event EventHandler RegionChanged {
\r
745 add { base.RegionChanged += value; }
\r
746 remove { base.RegionChanged -= value; }
\r
749 [Browsable (false)]
\r
750 [EditorBrowsable (EditorBrowsableState.Never)]
\r
751 public new event ScrollEventHandler Scroll {
\r
752 add { Events.AddHandler (ScrollEvent, value); }
\r
753 remove { Events.RemoveHandler (ScrollEvent, value); }
\r
756 [Browsable (false)]
\r
757 [EditorBrowsable (EditorBrowsableState.Always)]
\r
758 public new event EventHandler StyleChanged {
\r
759 add { base.StyleChanged += value; }
\r
760 remove { base.StyleChanged -= value; }
\r
763 [Browsable (false)]
\r
764 [EditorBrowsable (EditorBrowsableState.Never)]
\r
765 public new event EventHandler TabIndexChanged {
\r
766 add { base.TabIndexChanged += value; }
\r
767 remove { base.TabIndexChanged -= value; }
\r
770 [Browsable (false)]
\r
771 [EditorBrowsable (EditorBrowsableState.Never)]
\r
772 public new event EventHandler TabStopChanged {
\r
773 add { base.TabStopChanged += value; }
\r
774 remove { base.TabStopChanged -= value; }
\r
777 [Browsable (false)]
\r
778 [EditorBrowsable (EditorBrowsableState.Never)]
\r
779 public new event EventHandler TextChanged {
\r
780 add { base.TextChanged += value; }
\r
781 remove { base.TextChanged -= value; }
\r
784 [Browsable (false)]
\r
785 [EditorBrowsable (EditorBrowsableState.Never)]
\r
786 public new event EventHandler Validated {
\r
787 add { base.Validated += value; }
\r
788 remove { base.Validated -= value; }
\r
791 [Browsable (false)]
\r
792 [EditorBrowsable (EditorBrowsableState.Never)]
\r
793 public new event CancelEventHandler Validating {
\r
794 add { base.Validating += value; }
\r
795 remove { base.Validating -= value; }
\r
799 #region Private Methods
\r
800 private void ToolStripMenuTracker_AppFocusChange (object sender, EventArgs e)
\r
802 this.Close (ToolStripDropDownCloseReason.AppFocusChange);
\r
805 private void ToolStripMenuTracker_AppClicked (object sender, EventArgs e)
\r
807 this.Close (ToolStripDropDownCloseReason.AppClicked);
\r
811 #region Internal Properties
\r
812 internal override bool ActivateOnShow { get { return false; } }
\r