Click here to Skip to main content
13,147,037 members (61,308 online)
Rate this:
Please Sign up or sign in to vote.
See more:
In Visual Studio, various boxes slide away nicely.
I would like to do this with a treecontrol.

I've tried:
For i=0 to 10
width -=3

but it is very clunky.

Any ideas.

ps I thought I had posted this q before, but I can't find it.
Posted 23-Apr-11 4:50am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

There's an article on CP :

Simple auto-hide panel[^]

But it does not slide away. So you'd have to do that yourself. I guess one way to do this is to use a timer. The trick to make it smooth would be to do the entire slide-in/out in about 400-500 ms but in as small steps as you can achieve in that time.
Stuart Nathan 23-Apr-11 11:35am
I tried to simplify the question and I'm sorry.
In fact I am using a timer.

The form is quite complicated, and I guess it repaints as it slides, despite my using SuspendLayout and ResumeLayout.
Visual Studio Solution Explorer panel though is quire complicated, so ....
SAKryukov 24-Apr-11 13:28pm
The Visual Studio-like solution is even more complex. Get ready...
SAKryukov 25-Apr-11 16:44pm
My 5.
My alternative advice is looking at SharpDeveloper source code (its UI has fully-fledged docking support), but OP fails to understand even what am I talking about.
Please see my answer and the "discussion". (Sigh...)
Stuart Nathan 1-May-11 15:11pm
OK. I dare to come back to my question.
The original question said that I wished to slide the control away, not show and hide it.
Nishant understood this by suggesting a timer.

Now to be fair to everyone, I didn't truly understand the problem and I mislead you and myself.
If I remove the form paint, then it slides nicely.
So it is the painting of the form that causes the problem.
I admit that I do paint the form, which is why all the controls have a transparent background.
I try to prevent the repaint by having a variable set True when the slide event happens which causes the paint event to exit quickly, but this doesn't work.
Is there any way I can 'fix' the form while the sliding occurs?
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You can find source code of the implementation of UI similar to Visual Studio in the source code of SharpDevelop, an Open Source .NET IDE, see[^],[^].

You "slide-away" boxes is a part of it. :-)

Stuart Nathan 24-Apr-11 17:26pm
The whole idea is to do it myself.
I know this might seem stupid, but programming is a hobby and I want to learn more.
Using someone else's dll doesn't do it for me.
SAKryukov 24-Apr-11 21:23pm
I appreciate your motivation, but think about it in this way: asking a question "how to do it?" is already ***not*** doing it by yourself, don't you realize it. I never offered you the solution based on just using SharpDevelop library (even though you can do it); I did not even assume that.

Just the opposite, I suggest you to be even more crafty and independent that you probably planned for. My idea is: instead of explaining you the ideas behind such ID design I offer you to find these idea yourself.

Besides, you cannot possibly expect good ideas in quick answer in this specific field, because they cannot be expressed in compact form; this is rather a whole design. So, you have a choice: you either forget about help from any people or do it all by yourself or learn the source code.

I still think you can formally accept my advi e unless you find something bad in it.
Stuart Nathan 25-Apr-11 13:22pm
OK. I am not asking you to hold my hand.
But why point to websites that either don't load or don't point anywhere helpful.
Which CSharp library do you mean?
Come on.
I did a lot of searching on the web before asking the question. Nobody seems to know the answer, so I guess neither do you.
Sorry to be so critical.
SAKryukov 25-Apr-11 13:43pm
This is because you're wrong! Please check up properly before blaming or complaining.

The reference you need was only two clicks away from the link I gave you. OK, now I modified the second to link to the point of "Download", please see the updated answer. Sorry it was not 100% to the point.
You're not asking for holding your hand but this is what I almost do already.

Just realize this: you won't get much better answer anyway (you might hope for some alternative library though which could be better). The library you can download and use or study is pretty big. I don't think anyone will give you all of the ideas in one quick answer.

Stuart Nathan 25-Apr-11 16:00pm
I'm sorry, but do you expect me to download the application Sharp Development?
I'm used to Visual Studio. (Actually VB, but that's OK)
SAKryukov 25-Apr-11 16:41pm
What are your talking about?!!
You understand nothing. I talking about source code. Do you know what Open Source is?
I think you need to look at the source code to see how UI works, not developing using SharpDevelop.
Why are you even asking? It has nothing to do with the topic of our discussion.
Monjurul Habib 25-Apr-11 18:25pm
nice links.my5
SAKryukov 25-Apr-11 18:40pm
Thank you, Monjurul.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170915.1 | Last Updated 25 Apr 2011
Copyright © CodeProject, 1999-2017
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