button on windows form is off the page

Posted on 2006-05-25
Last Modified: 2010-04-16
i have a windows form with a menu, four horizontal labels, a datagrid and a button.  the window size is set to {464, 510}.  the button size is {456, 24} and the button location is {0, 431}.

when the form loads the button is so far down i can only see the top 5 or so pixels.  but is i resize the form, in any direction, the button then displays where it is supposed to be, at the button of the form.

i have set the button properties in various combinations to try to solve this, but the problem continues.
     dock: bottom/none
     locked: true/false

Question by:meyerc74
    LVL 6

    Expert Comment

    Try to delete this button and insert new button
    Best regards
    Adil Fazal
    LVL 2

    Accepted Solution

    Try using the Anchor property:
    this.myButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
    or through the button properties.

    Maybe you can anchor it to the bottom edge. That way the distance between the button and the bottom edge will remain the same, regardless of how you resize it.

    LVL 11

    Expert Comment

    Have you changed screen resolutions or Font Size recently?

    LVL 1

    Assisted Solution

    this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));


    LVL 2

    Expert Comment

    HI meyerc74,

    Did any of these solutions work?

    LVL 1

    Author Comment

    i apoligize for not getting back to you sooner.  i haven't had much a chance until to try this out.

    i tried setting the anchor...but the button was still mostly benieth the form end

    i haven't changed resolution or font size, beside this is machine indepentent, it happens on all pcs it is installed on
    LVL 1

    Author Comment

    i figured it out.

    for some reason or another the window opens about 10pts less than it is supposed to, but the button sees the bottom as it was in design mode.  i removed dock.bottom and raised the button about 10pts, set the anchors as noted above, and now it works as it should.

    thanks for the help

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    This video discusses moving either the default database or any database to a new volume.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now