Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
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 23-Apr-11 5:50am
Rate this: bad
good
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.
  Permalink  
Comments
Stuart Nathan at 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 at 24-Apr-11 13:28pm
   
The Visual Studio-like solution is even more complex. Get ready...
--SA
SAKryukov at 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 at 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
good
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 http://en.wikipedia.org/wiki/SharpDevelop[^], http://sharpdevelop.com/OpenSource/SD/Download/[^].
 
You "slide-away" boxes is a part of it. Smile | :)
 
—SA
  Permalink  
v2
Comments
Stuart Nathan at 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.
SAKryukov at 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 at 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 at 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 at 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 at 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.
--SA
Monjurul Habib at 25-Apr-11 18:25pm
   
nice links.my5
SAKryukov at 25-Apr-11 18:40pm
   
Thank you, Monjurul.
--SA

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

  Print Answers RSS
0 OriginalGriff 290
1 Jochen Arndt 150
2 Kornfeld Eliyahu Peter 149
3 PIEBALDconsult 110
4 Richard MacCutchan 105
0 OriginalGriff 6,080
1 DamithSL 4,648
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,624
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 25 Apr 2011
Copyright © CodeProject, 1999-2014
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