Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
next

but it is very clunky.

Any ideas.

ps I thought I had posted this q before, but I can't find it.
Posted

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 http://en.wikipedia.org/wiki/SharpDevelop[^], http://sharpdevelop.com/OpenSource/SD/Download/[^].

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

—SA
 
Share this answer
 
v2
Comments
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.
Sorry.
Sergey Alexandrovich Kryukov 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.
--SA
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.
Sergey Alexandrovich Kryukov 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.

--SA
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)
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.
 
Share this answer
 
Comments
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 ....
Sergey Alexandrovich Kryukov 24-Apr-11 13:28pm    
The Visual Studio-like solution is even more complex. Get ready...
--SA
Sergey Alexandrovich Kryukov 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...)
--SA
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?

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900