|
-
Feb 28th, 2006, 01:39 PM
#1
Thread Starter
Hyperactive Member
Collasping a Window[RESOLVED]
Anyone have an reference Code for Collapsing a Say a Text Box,List view Etc...So a New Window can be re opened in its spot...Similar like OutLook would have or some Media Players...
That way when a person Collapse's one Window they can open a new one in its place in the same spot... 
did some searching on MSDN this is some code i found can someone look at it and help me with it
Code:
namespace CS_Events_Code
{
using System;
using Microsoft.VisualStudio.CommandBars;
using Extensibility;
using EnvDTE;
using EnvDTE80;
using System.Windows.Forms;
public class Connect : Object, IDTExtensibility2
{
public Connect()
{
}
public void OnConnection(object application, ext_ConnectMode
connectMode, object addInInst, ref Array custom)
{
applicationObject = (DTE2)application;
addInInstance = (AddIn)addInInst;
EnvDTE80.Events2 events = (EnvDTE80.Events2
)applicationObject.Events;
windowsVisEvents =
(EnvDTE80.WindowVisibilityEvents)events.get_WindowVisibilityEvents
(null);
// Connect to each delegate exposed from the windows visibiliy
// events object retrieved above
windowsVisEvents.WindowHiding += new
_dispWindowVisibilityEvents_WindowHidingEventHandler
(this.WindowHiding);
windowsVisEvents.WindowShowing += new
_dispWindowVisibilityEvents_WindowShowingEventHandler
(this.WindowShowing);
}
public void OnDisconnection(ext_DisconnectMode disconnectMode,
ref Array custom)
{
if (windowsVisEvents != null)
{
windowsVisEvents.WindowHiding -= new
_dispWindowVisibilityEvents_WindowHidingEventHandler
(this.WindowHiding);
windowsVisEvents.WindowShowing -= new
_dispWindowVisibilityEvents_WindowShowingEventHandler
(this.WindowShowing);
}
}
public void OnAddInsUpdate(ref Array custom)
{
}
public void OnStartupComplete(ref Array custom)
{
}
public void OnBeginShutdown(ref Array custom)
{
}
private DTE2 applicationObject;
private AddIn addInInstance;
private EnvDTE80.WindowVisibilityEvents windowsVisEvents;
public void WindowHiding(EnvDTE.Window winRef)
{
MessageBox.Show("The window " + winRef.Caption + " is hiding.");
}
public void WindowShowing(EnvDTE.Window winRef)
{
MessageBox.Show("The window " + winRef.Caption + " is showing.");
}
}
}
I have the above code on its on .cs file
Code:
[GuidAttribute("84DE07BC-43A2-4275-BCF9-D207D20E49ED")]
public interface WindowVisibilityEvents : _WindowVisibilityEvents, _dispWindowVisibilityEvents_Event
The Above Code in the Program.cs under the Main....
Thxs
Last edited by Rattlerr; Feb 28th, 2006 at 10:07 PM.
-
Feb 28th, 2006, 08:01 PM
#2
Re: Collasping a Window
I for one don't understand what you mean.
-
Feb 28th, 2006, 08:08 PM
#3
Thread Starter
Hyperactive Member
Re: Collasping a Window
Ok its just like in OutLook you have an Area (ListView or TreeView) that is Hidden Until it is Clicked on once it is Clicked on It will Expand that Area so the user can view it...
OutLook uses this Alot where Area's are Hidden until they are Clicked then They Appear...Would be Similar to say a DropDown button in Retro Spect to where when it is clicked it shows its Contents...
Pretty much the same idea ..Click on a ToolStrip Button and it Expands that Area ,Click it again and It will Collapse that area...
-
Feb 28th, 2006, 08:34 PM
#4
Re: Collasping a Window
If you want the user to be able to adjust by dragging then you would use a Splitter in .NET 1.x and a SplitContainer in .NET 2.0. You then anchor the controls in each pane appropriately so that when you move the splitter the controls will behave accordingly. If you don't want the size of the area to be user-adjustable then just use a Panel or Panels and adjust the size- and location-related properties accordingly.
-
Feb 28th, 2006, 09:16 PM
#5
Thread Starter
Hyperactive Member
Re: Collasping a Window
Ok i follow you on that..and Noted it..Thxs for the Help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|