Results 1 to 8 of 8

Thread: Maximized Form Covers Taskbar

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    400

    Maximized Form Covers Taskbar

    I used the code from http://www.vbforums.com/showpost.php...12&postcount=5 to remove the titlebar from my form and keep is resizable but whenever I maximize the window, it fills up the entire screen, covering up the taskbar. How do I stop it from doing that?

  2. #2

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    400

    Re: Maximized Form Covers Taskbar

    Sorry, I'm confused. What does that code do and how do I use it? Is it supposed to maximize the window properly or is it supposed to fix it so I can maximize the form correctly? Because I just used it in my form and nothing happened.

  4. #4
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Maximized Form Covers Taskbar

    it finds out the area of the desktop and it sizes / positions the form to that area.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    400

    Re: Maximized Form Covers Taskbar

    Do you think you could combine the two codes so they work together? Thanks

  6. #6
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Maximized Form Covers Taskbar

    add the API declarations, then your form load needs to look like:
    VB Code:
    1. Private Sub Form_Load()
    2.     Dim deskRECT As RECT
    3.    
    4.     Call SystemParametersInfo(SPI_GETWORKAREA, 0&, deskRECT, 0&)
    5.     With deskRECT
    6.         Me.Move .lLeft * Screen.TwipsPerPixelX, _
    7.                 .lTop * Screen.TwipsPerPixelX, _
    8.                 (.lRight - .lLeft) * Screen.TwipsPerPixelX, _
    9.                 (.lBottom - .lTop) * Screen.TwipsPerPixelX
    10.     End With
    11.    
    12.     SetWindowLong Me.hwnd, GWL_STYLE, GetWindowLong(Me.hwnd, GWL_STYLE) + WS_DLGFRAME
    13. End Sub

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    400

    Re: Maximized Form Covers Taskbar

    If I have my taskbar set to autohide, then I'll just make the form's height Screen.Height-5. Now I'm just trying to figure out a short, simple code to make my form unmovable and unresizable to make the form have more of a "maximized effect".
    Last edited by abazabam; Jan 11th, 2007 at 12:22 AM.

  8. #8
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Maximized Form Covers Taskbar

    yes, i see where you're coming from now - and I'm afraid I don't have an answer for you, regarding the taskbar thing at least.

    for your other questions, you'll probably want to check out Karl E. Peterson's FormBdr class which allows you to change various design-time only properties (such as Moveable, Sizable, etc.) at runtime.

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