Click here to Skip to main content
11,411,922 members (60,725 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Windows VB.NET
Hi

I want to make a auto hide sidebar.
as we can see in visual studio the toolbox and other property windows use to open at left or at right side of the window

Please tell me solution of this or anything similar to this

Thank you
Posted 20-Dec-12 23:52pm
Code-Hunt7.1K
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I was doing something like you said this morning.

1. Add a panel and name it "ObjectExplorerPanel".
2. Add a button "pinButton" (for pinning and un-pinning) and set it's text to "pin", within the above panel.
3. Add a button "explorerCloseButton" (for closing the sidebar) within the above panel.
4. Add a button out of the panel "ShowOExpButton".

And do the code as it is here.


namespace Mero
{
    public partial class MeroMain : Form
    {
        public MeroMain()
        {
            InitializeComponent();
        }
 
        private void explorerCloseButton_Click(object sender, EventArgs e)
        {
            this.ObjectExplorerPanel.Hide();
        }
 
        private void objectExplorerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.ObjectExplorerPanel.Show();
        }
 
        private void pinButton_Click(object sender, EventArgs e)
        {
            if (this.pinButton.Text == "pin")
            {
                this.pinButton.Text = "unpin";
                this.pinButton.BackgroundImage = Properties.Resources.unpin;
                this.ObjectExplorerPanel.Size = new Size(0, 438);
                this.showOExpButton.BringToFront();
            }
            else if (this.pinButton.Text == "unpin")
            {
                this.pinButton.Text = "pin";
                this.pinButton.BackgroundImage = Properties.Resources.pin;
                this.ObjectExplorerPanel.Size = new Size(200, 438);
            }
        }
 
        private void showOExpButton_Click(object sender, EventArgs e)
        {
            this.ObjectExplorerPanel.Size = new Size(200, 438);
            this.showOExpButton.SendToBack();
        }
 
        private void ObjectExplorerPanel_MouseLeave(object sender, EventArgs e)
        {
            if (this.pinButton.Text == "unpin")
            {
                this.ObjectExplorerPanel.Size = new Size(0, 438);
                this.showOExpButton.BringToFront();
            }
        }
    }
}
 

I could not upload the file so, i pasted the code over here.


Hope this helps.
  Permalink  
Comments
Snehasish Nandy at 21-Dec-12 5:19am
   
is it possible to share the screen..??means image if u can snapshot..
Anaya Upadhyay at 21-Dec-12 6:13am
   
it would be possible, but will you tell me how to upload the snapshot
Tadit Dash at 21-Dec-12 6:45am
   
You can upload on the website Ge.tt and give him the link so that he can download and refer that.

Thanks...
Snehasish Nandy at 21-Dec-12 6:49am
   
Please upload ur screen view..then it will be easy for me to understand the thing..
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Please check
1. Article - A Visual Studio 2005-like Interface[^],
2. Question - Auto hide side bar[^].

Thanks...
Comments
Snehasish Nandy at 21-Dec-12 5:37am
   
Thanks..
Tadit Dash at 21-Dec-12 5:57am
   
Please accept this answer, if it has helped you in any way.
This will help others to find the answer in one go and you will also be awarded with some points for this action...

Thanks,
Tadit
Tadit Dash at 21-Dec-12 6:05am
   
Thanks for accepting the answer @Snehasish.
Snehasish Nandy at 21-Dec-12 6:22am
   
Thank u..@tadit
Tadit Dash at 21-Dec-12 6:36am
   
You are most welcome, my pleasure @Snehasish.
Snehasish Nandy at 21-Dec-12 6:25am
   
One more thing..can u please tell me how to add controls to that..means i m running the application and i added few controls..but it's showing for every tab i m opening..
Tadit Dash at 21-Dec-12 6:36am
   
Are you asking about the Code Project article?
Snehasish Nandy at 21-Dec-12 6:37am
   
yes..u tried this???
Tadit Dash at 21-Dec-12 6:42am
   
No I have not tried, but I will try it and let you know how can your question be solved ?
Snehasish Nandy at 21-Dec-12 6:48am
   
Ok please..will wait for ur response..
Tadit Dash at 21-Dec-12 6:59am
   
Ok thanks...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

I've shared the file here.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 268
1 Sergey Alexandrovich Kryukov 200
2 Sascha Lefévre 170
3 ProgramFOX 130
4 Maciej Los 110
0 Sergey Alexandrovich Kryukov 8,955
1 OriginalGriff 7,158
2 Maciej Los 3,480
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web01 | 2.8.150414.5 | Last Updated 22 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100