Results 1 to 4 of 4

Thread: Docking a window to the side of your desktop

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Location
    UK
    Posts
    2

    Exclamation

    HI, I'm making a program that i need to dock to the side of my desktop. Only thing is i don't know how the hell to do this!!! I found info on docking in an MDI window but not in explorer!!! Can n e 1 pls help???

    THX :þ
    Cerealkillerbern

  2. #2
    Addicted Member
    Join Date
    Feb 2001
    Location
    Upstate NY
    Posts
    210
    you need a timer(timer1) in this example:
    Code:
    Private Sub Form_Load()
    Timer1.Interval = 50
    End Sub
    
    Private Sub Timer1_Timer()
    Dim Spce&
    Spce = 500 'change that to change how far away the window can be before
    'it gets docked
    If Me.Left < Spce Then Me.Left = 0
    If Me.Top < Spce Then Me.Top = 0
    If Me.Left + Me.Width > Screen.Width - Spce Then Me.Left = Screen.Width - Me.Width
    If Me.Top + Me.Height > Screen.Height - Spce Then Me.Top = Screen.Height - Me.Height
    End Sub
    If you try to dock it to the bottom of the screen, the taskbar kind gets in the way.
    < o >

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Location
    UK
    Posts
    2

    THANKS!!!

    Thank u v.much! thats helped alot!
    I can now do that in my messenger project. Thanx again!
    Cerealkillerbern

  4. #4
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    there is a class that does a better (more windows like job of docking) avalible at www.vbaccelerator.com that lets you dock a window just like the task bar!!!!
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

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