EasyTabs Provides the base functionality for any tab renderer, taking care of actually rendering and detecting whether the cursor is over a tab. Any custom tab renderer needs to inherit from this class, just as does. Background of the content area for the tab when the tab is active; its width also determines how wide the default content area for the tab is. Image to display on the left side of an active tab. Image to display on the right side of an active tab. Area on the screen where the add button is located. Image to display when the user hovers over the add button. Image to display for the add button when the user is not hovering over it. The background, if any, that should be displayed in the non-client area behind the actual tabs. The hover-over image that should be displayed on each tab to close that tab. The image that should be displayed on each tab to close that tab. When the user is dragging a tab, this represents the point where the user first clicked to start the drag operation. Background of the content area for the tab when the tab is inactive; its width also determines how wide the default content area for the tab is. Image to display on the left side of an inactive tab. Image to display on the right side of an inactive tab. Flag indicating whether or not a tab is being repositioned. Maximum area on the screen that tabs may take up for this application. The parent window that this renderer instance belongs to. The number of tabs that were present when we last rendered; used to determine whether or not we need to redraw tab instances. Flag indicating whether or not rendering has been suspended while we perform some operation. When the user is dragging a tab, this represents the horizontal offset within the tab where the user clicked to start the drag operation. The width of the content area that we should use for each tab. Flag indicating whether or not a tab was being repositioned. Default constructor that initializes the and properties. The parent window that this renderer instance belongs to. Height of the tab content area; derived from the height of . Flag indicating whether or not we should display the add button. Amount of space we should put to the left of the caption when rendering the content area of the tab. Amount of space that we should leave to the right of the caption when rendering the content area of the tab. Amount of space that we should leave between the top of the content area and the top of the caption text. Amount of space we should put to the left of the tab icon when rendering the content area of the tab. Amount of space that we should leave to the right of the icon when rendering the content area of the tab. Amount of space that we should leave between the top of the content area and the top of the icon. Amount of space that we should put to the left of the close button when rendering the content area of the tab. Amount of space that we should leave to the right of the close button when rendering the content area of the tab. Amount of space that we should leave between the top of the content area and the top of the close button. Amount of space that we should put to the left of the add tab button when rendering the content area of the tab. Amount of space that we should leave to the right of the add tab button when rendering the content area of the tab. Amount of space that we should leave between the top of the content area and the top of the add tab button. If the renderer overlaps the tabs (like Chrome), this is the width that the tabs should overlap by. For renderers that do not overlap tabs (like Firefox), this should be left at 0. Horizontal distance that a tab must be dragged before it starts to be repositioned. Distance that a user must drag a tab outside of the tab area before it shows up as "torn" from its parent window. Flag indicating whether or not a tab is being repositioned. Width of the content area of the tabs. Maximum area that the tabs can occupy. Excludes the add button. Initialize the and fields in case the user starts dragging a tab. Object from which this event originated. Arguments associated with the event. End the drag operation by resetting the and fields and setting to false. Object from which this event originated. Arguments associated with the event. If the user is dragging the mouse, see if they have passed the threshold and, if so, officially begin the tab drag operation. Object from which this event originated. Arguments associated with the event. When items are added to the tabs collection, we need to ensure that the 's minimum width is set so that we can display at least each tab and its close buttons. List of tabs in the . Arguments associated with the event. Called from the to determine which, if any, of the the is over. The list of tabs that we should check. The relative position of the cursor within the window. The tab within that the is over; if none, then null is returned. Helper method to detect whether the is within the given and, if it is, whether it is over a non-transparent pixel in the given . Screen area that we should check to see if the is within. Image contained within that we should check to see if the is over a non- transparent pixel. Current location of the cursor. True if the is within the given and is over a non-transparent pixel in the . Tests whether the is hovering over the add tab button. Current location of the cursor. True if the is within and is over a non-transparent pixel of , false otherwise. Tests whether the is hovering over the given . Tab that we are to see if the cursor is hovering over. Current location of the cursor. True if the is within the of the and is over a non- transparent pixel of , false otherwise. Checks to see if the is over the of the given . The tab whose we are to check to see if it contains . Current position of the cursor. True if the 's contains , false otherwise. Renders the list of to the screen using the given . List of tabs that we are to render. Graphics context that we should use while rendering. Current location of the cursor on the screen. Flag indicating whether or not the redraw should be forced. Offset within that the tabs should be rendered. Internal method for rendering an individual to the screen. Graphics context to use when rendering the tab. Individual tab that we are to render. Area of the screen that the tab should be rendered to. Current position of the cursor. Image to use for the left side of the tab. Image to use for the center of the tab. Image to use for the right side of the tab. Gets the image to use for the left side of the . Tab that we are retrieving the image for. The image for the left side of . Gets the image to use for the center of the . Tab that we are retrieving the image for. The image for the center of . Gets the image to use for the right side of the . Tab that we are retrieving the image for. The image for the right side of . Called when a torn tab is dragged into the of . Places the tab in the list and sets to true to simulate the user continuing to drag the tab around in the window. Tab that was dragged into this window. Location of the user's cursor. Renderer that produces tabs that mimic the appearance of the Chrome browser. Constructor that initializes the various resources that we use in rendering. Parent window that this renderer belongs to. Since Chrome tabs overlap, we set this property to the amount that they overlap by. The type of theme being used to render the desktop. Windows 2000-esque theme. Contemporary theme, but without Aero enabled. Full compositing enabled in the theme. Provides data for the events. Index of the item being changed. Initializes a new instance of the class. Index of the item being changed. Gets the index of the item changed. List of possible modifications. The list has been cleared. A new item has been added. An item has been modified. An item has been removed. A range of items has been added. A range of items has been removed. Provides data for the events. Modification being made to the list. Initializes a new instance of the class. Modification being made to the list. Index from which the modifications start. Number of modifications being made. Gets the type of list modification. Provides data for the events. Number of items in the range. Index of the first item in the range. Initializes a new instance of the class. Index of the first item in the range. Number of items in the range. Gets the index of the first item in the range. Gets the number of items in the range. Represents a strongly typed list of objects with events. The type of elements in the list. Synchronization root for thread safety. Flag indicating whether events are being suppressed during an operation. Initializes a new instance of the class that is empty and has the default initial capacity. Initializes a new instance of the class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied. The collection whose elements are copied to the new list. The collection is null. Initializes a new instance of the class that is empty and has the specified initial capacity. The number of elements that the new list can initially store. The capacity is less than 0. Gets whether the events are currently being suppressed. Overloads . Gets an object that can be used to synchronize access to the . Adds an item to the end of the list. Item to add to the list. Index of the new item in the list. Overloads . This operation is thread-safe. Overloads . This operation is thread-safe. Occurs whenever the list's content is modified. Occurs whenever the list is cleared. Occurs whenever a new item is added to the list. Occurs whenever a item is modified. Occurs whenever an item is removed from the list. Occurs whenever a range of items is added to the list. Occurs whenever a range of items is removed from the list. Overloads . This operation is thread-safe. Overloads . This operation is thread-safe. Overloads . This operation is thread-safe. Overloads . This operation is thread-safe. Overloads . This operation is thread-safe. Overloads . This operation is thread-safe. Overloads . This operation is thread-safe. Removes the specified list of entries from the collection. Collection to be removed from the list. This operation employs method for removing each individual item which is thread-safe. However overall operation isn't atomic, and hence does not guarantee thread-safety. Stops raising events until is called. Resumes raising events after call. Raises and events. An that contains the event data. Raises events. An that contains the event data. Raises and events. An that contains the event data. Raises and events. An that contains the event data. Raises and events. An that contains the event data. Raises and events. An that contains the event data. Raises and events. An that contains the event data. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized resource of type System.Drawing.Bitmap. Looks up a localized resource of type System.Drawing.Bitmap. Looks up a localized resource of type System.Drawing.Bitmap. Looks up a localized resource of type System.Drawing.Bitmap. Looks up a localized resource of type System.Drawing.Bitmap. Looks up a localized resource of type System.Drawing.Bitmap. Looks up a localized resource of type System.Drawing.Bitmap. Looks up a localized resource of type System.Drawing.Bitmap. Looks up a localized resource of type System.Drawing.Bitmap. Looks up a localized resource of type System.Drawing.Bitmap. Looks up a localized resource of type System.Drawing.Bitmap. Looks up a localized resource of type System.Drawing.Bitmap. Looks up a localized resource of type System.Byte[]. Looks up a localized resource of type System.Byte[]. Looks up a localized resource of type System.Byte[]. Looks up a localized resource of type System.Byte[]. Looks up a localized resource of type System.Byte[]. Wraps a instance (), that represents the content that should be displayed within a tab instance. Flag indicating whether or not this tab is active. Content that should be displayed within the tab. Parent window that contains this tab. Default constructor that initializes the various properties. Parent window that contains this tab. Parent window that contains this tab. Flag indicating whether or not we should display the close button for this tab. The caption that's displayed in the tab's title (simply uses the of ). Flag indicating whether or not this tab is active. The icon that's displayed in the tab's title (simply uses the of ). The area in which the tab is rendered in the client window. The area of the close button for this tab in the client window. Pre-rendered image of the tab's background. The content that should be displayed for this tab. Called from when we need to generate a thumbnail for a tab when it is torn out of its parent window. We simply call to copy the screen contents to a . An image of the tab's contents. Event that is fired when 's event is fired. Event that is fired when 's event is fired. Event handler that is invoked when 's event is fired, which in turn fires this class' event. Object from which this event originated ( in this case). Arguments associated with the event. Event handler that is invoked when 's event is fired, which in turn fires this class' event. Object from which this event originated ( in this case). Arguments associated with the event. Unsubscribes the tab from any event handlers that may have been attached to its or events. Event arguments class for a cancelable event that occurs on a collection of collection of s. Action that is being performed. The tab that the is being performed on. Index of the tab within the collection. Event arguments class for an event that occurs on a collection of collection of s. Action that is being performed. The tab that the is being performed on. Index of the tab within the collection. Flag indicating if the user was dragging the tab when the event occurred. Base class that contains the functionality to render tabs within a WinForms application's title bar area. This is done through a borderless overlay window () rendered on top of the non-client area at the top of this window. All an implementing class will need to do is set the property and begin adding tabs to . Event delegate for and that allows subscribers to cancel the event and keep it from proceeding. Object for which this event was raised. Data associated with the event. Event delegate for and . Object for which this event was raised. Data associated with the event. Flag indicating whether or not each tab has an Aero Peek entry allowing the user to switch between tabs from the taskbar. Height of the non-client area at the top of the window. Borderless window that is rendered over top of the non-client area of this window. The preview images for each tab used to display each tab when Aero Peek is activated. When switching between tabs, this keeps track of the tab that was previously active so that, when it is switched away from, we can generate a fresh Aero Peek preview image for it. Maintains the previous window state so that we can respond properly to maximize/restore events in . Class responsible for actually rendering the tabs in . List of tabs to display for this window. Default constructor. Flag indicating whether composition is enabled on the desktop. Flag indicating whether or not each tab has an Aero Peek entry allowing the user to switch between tabs from the taskbar. Flag indicating whether a tooltip should be shown when hovering over a tab. Tooltip UI element to show when hovering over a tab. List of tabs to display for this window. The renderer to use when drawing the tabs. The tab that is currently selected by the user. Gets or sets the index of the tab that is currently selected by the user. Flag indicating whether the application itself should exit when the last tab is closed. Flag indicating whether we are in the process of closing the window. Application context under which this particular window runs. Height of the "glassed" area of the window's non-client area. Area of the screen in which tabs can be dropped for this window. Calls to set various attributes on the window. Attributes to set on the window. Event handler that is invoked when the event is fired. Instantiates and clears out the window's caption. Arguments associated with the event. When the window's state (maximized, minimized, or restored) changes, this sets the size of the non-client area at the top of the window properly so that the tabs can be displayed. Event that is raised immediately prior to a tab being deselected (). Event that is raised after a tab has been deselected. Event that is raised immediately prior to a tab being selected (). Event that is raised after a tab has been selected. Event that is raised after a tab has been clicked. Callback that should be implemented by the inheriting class that will create a new object when the add button is clicked. A newly created tab. Callback for the event. Arguments associated with the event. Callback for the event. Called when a is in the process of losing focus. Grabs an image of the tab's content to be used when Aero Peek is activated. Arguments associated with the event. Generate a new thumbnail image for . Tab that we need to generate a thumbnail for. Callback for the event. Arguments associated with the event. Callback for the event. Arguments associated with the event. Callback for the event. Called when a gains focus. Sets the active window in Aero Peek via a call to . Arguments associated with the event. Handler method that's called when Aero Peek needs to display a thumbnail for a ; finds the preview bitmap generated in and returns that. Object from which this event originated. Arguments associated with this event. Callback for the event that resizes the form of the currently selected tab when the size of the client area for this window changes. Arguments associated with the event. Resizes the form of the to match the size of the client area for this window. Tab whose form we should resize; if not specified, we default to . Override of the handler for the paint background event that is left blank so that code is never executed. Arguments associated with the event. Forwards a message received by to the underlying window. Message received by the overlay. Handler method that's called when the user clicks on an Aero Peek preview thumbnail. Finds the tab associated with the thumbnail and focuses on it. Object from which this event originated. Arguments associated with this event. Handler method that's called when the user clicks the close button in an Aero Peek preview thumbnail. Finds the window associated with the thumbnail and calls on it. Object from which this event originated. Arguments associated with this event. Callback that is invoked whenever anything is added or removed from so that we can trigger a redraw of the tabs. Object for which this event was raised. Arguments associated with the event. Creates a new thumbnail for when the application is initially enabled for AeroPeek or when it is turned on sometime during execution. Tab that we are to create the thumbnail for. Thumbnail created for . When a child tab updates its property, it should call this method to update the icon in the AeroPeek preview. Tab whose icon was updated. The new icon to use. If this is left as null, we use on . Event handler that is called when a tab's property is changed, which re-renders the tab text and updates the title of the Aero Peek preview. Object from which this event originated (the object in this case). Arguments associated with the event. Event handler that is called when a tab's event is fired, which removes the tab from and re-renders . Object from which this event originated (the in this case). Arguments associated with the event. Calls on to force a redrawing of the tabs. Overrides the handler so that we can detect when the user has maximized or restored the window and adjust the size of the non-client area accordingly. Arguments associated with the event. Overrides the message processor for the window so that we can respond to windows events to render and manipulate the tabs properly. Message received by the pump. Calls , adds the resulting tab to the collection, and activates it. Removes from and selects the next applicable tab in the list. Tab that is being closed. Called when a message is received to see where in the non-client area the user clicked. Screen location that we are to test. Handle to the window for which we are performing the test. One of the values, depending on where the user clicked. Required designer variable. Clean up any resources being used. true if managed resources should be disposed; otherwise, false. Required method for Designer support - do not modify the contents of this method with the code editor. Application context to use when starting a application via . Used to track open windows so that the entire application doesn't quit when the first-opened window is closed. List of all opened windows. List of all opened windows. Constructor; takes the initial window to display and, if it's not closing, opens it and shows it. Initial window to display. Adds to and attaches event handlers to its event to keep track of it. Window that we're opening. Handler method that's called when an item in has its event invoked. Removes the window from and, if there are no more windows open, calls . Object from which this event originated. Arguments associated with the event. Borderless overlay window that is moved with and rendered on top of the non-client area of a instance that's responsible for rendering the actual tab content and responding to click events for those tabs. All of the parent forms and their overlays so that we don't create duplicate overlays across the application domain. Tab that has been torn off from this window and is being dragged. Thumbnail representation of used when dragging. Flag used in and to track whether the user was click/dragging when a particular event occurred. Flag indicating whether or not has been installed as a hook. Semaphore to control access to . Flag indicating whether or not the underlying window is active. Flag indicating whether we should draw the titlebar background (i.e. we are in a non-Aero environment). When a tab is torn from the window, this is where we store the areas on all open windows where tabs can be dropped to combine the tab with that window. Pointer to the low-level mouse hook callback (). Delegate of ; declared as a member variable to keep it from being garbage collected. Index of the tab, if any, whose close button is being hovered over. Queue of mouse events reported by that need to be processed. Consumer thread for processing events in . Parent form for the overlay. Blank default constructor to ensure that the overlays are only initialized through . Creates the overlay window and attaches it to . Parent form that the overlay should be rendered on top of. Makes sure that the window is created with an flag set so that it can be alpha-blended properly with the content ( ) underneath the overlay. Primary color for the titlebar background. Type of theme being used by the OS to render the desktop. Gradient color for the titlebar background. Screen area in which tabs can be dragged to and dropped for this window. Retrieves or creates the overlay for . Parent form that we are to create the overlay for. Newly-created or previously existing overlay for . Attaches the various event handlers to so that the overlay is moved in synchronization to . Event handler that is called when is in the process of closing. This uninstalls from the low- level hooks list and stops the consumer thread that processes those events. Object from which this event originated, in this case. Arguments associated with this event. Consumer method that processes mouse events in that are recorded by . Hook callback to process messages to highlight/un-highlight the close button on each tab. The message being received. Additional information about the message. Additional information about the message. A zero value if the procedure processes the message; a nonzero value if the procedure ignores the message. Draws the titlebar background behind the tabs if Aero glass is not enabled. Graphics context with which to draw the background. Event handler that is called when 's event is fired which re-renders the tabs. Object from which the event originated. Arguments associated with the event. Event handler that is called when 's , , or events are fired which re-renders the tabs. Object from which the event originated. Arguments associated with the event. Sets the position of the overlay window to match that of so that it moves in tandem with it. Renders the tabs and then calls to blend the tab content with the underlying window ( ). Flag indicating whether a full render should be forced. Renders the tabs and then calls to blend the tab content with the underlying window ( ). Current position of the cursor. Flag indicating whether a full render should be forced. Gets the relative location of the cursor within the overlay. Cursor position that represents the absolute position of the cursor on the screen. The relative location of the cursor within the overlay. Overrides the message pump for the window so that we can respond to click events on the tabs themselves. Message received by the pump. Event handler that is called when 's event is fired. Object from which this event originated. Arguments associated with the event. Event handler that is called when 's event is fired. Object from which this event originated. Arguments associated with the event. Event handler that is called when 's event is fired. Object from which this event originated. Arguments associated with the event. Contains information on mouse events captured by and processed by . Code for the event. wParam value associated with the event. lParam value associated with the event. Data associated with the mouse event. Contains a semi-transparent window with a thumbnail of a tab that has been torn away from its parent window. This thumbnail will follow the cursor around as it's dragged around the screen. Window that contains the actual thumbnail image data. Offset of the cursor within the torn tab representation while dragging. Pointer to the low-level mouse hook callback (). Flag indicating whether is installed. Delegate of ; declared as a member variable to keep it from being garbage collected. Flag indicating whether or not the constructor has finished running. Thumbnail of the tab we are dragging. Constructor; initializes the window and constructs the tab thumbnail image to use when dragging. Tab that was torn out of its parent window. Renderer instance to use when drawing the actual tab. Event handler that's called from ; calls to unsubscribe from the mouse hook. Object from which this event originated. Arguments associated with this event. Hook callback to process messages to move the thumbnail along with the cursor. The message being received. Additional information about the message. Additional information about the message. A zero value if the procedure processes the message; a nonzero value if the procedure ignores the message. Updates the window position to keep up with the cursor's movement. Current position of the cursor. Event handler that's called when the window is loaded; shows and installs the mouse hook via . Arguments associated with this event. Event handler that is called when the window is closing; closes as well. Arguments associated with this event. Calls to update the position of the thumbnail and blend it properly with the underlying desktop elements. Form that actually displays the thumbnail content for . Default constructor. Makes sure that the window is created with an flag set so that it can be alpha-blended properly with the desktop contents underneath it. Renders the tab thumbnail () using the given dimensions and coordinates and blends it properly with the underlying desktop elements. Thumbnail to display. Opacity that should be displayed with. Width of . Height of . Screen position that should be displayed at.