需要帮助开发自动隐藏侧边栏 [英] Need help in developing an auto hide sidebar

查看:82
本文介绍了需要帮助开发自动隐藏侧边栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想制作一个自动隐藏边栏。

我们可以在visual studio中看到工具箱和其他属性窗口用来打开在窗口的左侧或右侧



请告诉我这个或类似的解决方案



谢谢

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

推荐答案

我今天早上做的就像你说的那样。



1.添加一个面板并将其命名为ObjectExplorerPanel。

2.在上面的面板中添加一个pinButton按钮(用于固定和取消固定)并将其文本设置为pin。 br />
3.在上面的面板中添加一个explorerCloseButton按钮(用于关闭侧边栏)。

4.在ShowOExpButton面板中添加一个按钮。



并执行此处的代码。





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.


请检查

1文章 - 类似Visual Studio 2005的界面 [ ^ ],
2.问题 - 自动隐藏侧栏 [ ^ ]。



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

Thanks...


我已共享文件此处


这篇关于需要帮助开发自动隐藏侧边栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆