Results 1 to 3 of 3

Thread: Sliding control within a form

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    515

    Sliding control within a form

    My tabcontrol is in the center of my winform.

    I need to get the control to smoothly slide to the form's left border on button click.

    What is the best way to get this done without compromising UI experience ?

    Thanks for any help.

  2. #2
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: Sliding control within a form

    Hi,

    Use the Location property;

    vb Code:
    1. Tabcontrol.Location = New Point(150,150)' or the location where you want it to
    Last edited by sparrow1; Apr 23rd, 2009 at 04:11 PM.
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  3. #3
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: Sliding control within a form

    If you want to animate it, you can use a timer that changes the location of your control every x milliseconds. However, to get it to run smoothly, your timer will need to have a very short interval, which will cause it to tick very often, which will not be very good on performance.

    If this is really something you want in your application I would suggest having a look at WPF instead of WinForms, where these animations are much more easily done.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width