Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 8th, 2008, 12:24 AM
Authorized User
 
Join Date: Jul 2007
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to implement auto-hide?

Hello,

 I want a form with panel exhibits auto hide functionality similar to VS2005.

i.e when the mousehover the toolbox main area contents get hidden behind the toolbox.

When the button with "auto hide" is pressed, it will always be visible .

How to achieve this with c# (Windows application).


Thanks in advance.

with regards.
 
Old January 8th, 2008, 04:52 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Well basically you'll have to code it yourself. This will involve setting the Dock property, e.g. to DockStyle.Left for when the panel is always visible. Then you'd have to control the Width property, probably based on a Timer with various settings to let you know if the mouse was over the control.

Alternatively search for some existing controls which provide this functionality (a quick search revealed PlusDock and Nevron which provide this functionality, or this free script: http://www.codeproject.com/KB/miscct...icdocking.aspx ).

/- Sam Judson : Wrox Technical Editor -/
 
Old January 8th, 2008, 07:51 AM
Registered User
 
Join Date: Jan 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default


hi...

i hav achieved this by the following code....hope u will be benefitted also.....


/*

the specific part which we want to hide is actually another winForm named EBar.

there are two buttons placed on it --
1) btnleft - on Left Hand Side of EBar
2)btnright - on Right Hand Side of EBar



*/

private void btnLeft_Click(object sender, EventArgs e)
        {
            EBar.Width = 26;// 26 -so tht btnright doesn't get hidden
            btnLeft.Visible = false;
            btnRight.Left = 0; // i m using EBar on the left hand side of my main Form.
            btnRight.Visible = true;
        }

private void btnRight_Click(object sender, EventArgs e)
        {
            btnLeft.Left = 295;
            EBar.Width = 338;
            EBar.Height = 675;
            EBar.Top = 0;
            EBar.Left = 24;
            btnLeft.Visible = true;
            btnRight.Visible = false;
        }

i m sure u r getting the idea behind the code........
enjoy.....






Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to implement AJAX Maxxim ASP.NET 2.0 Professional 2 October 22nd, 2007 01:35 PM
Auto Refresh and Auto Delete deontae45 VB.NET 2002/2003 Basics 1 September 29th, 2006 04:53 PM
how to implement this?please help? Desmond Classic ASP Databases 1 May 27th, 2005 11:06 PM
Cannot implement or extend Rusk Apache Tomcat 1 June 16th, 2004 06:29 AM
how can i best implement a many to many relation? Haroldd Access 1 July 2nd, 2003 03:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.