button on windows form is off the page

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

LVL 1
meyerc74Asked:
Who is Participating?
 
MyersACommented:
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.

VM
0
 
MuhammadAdilCommented:
Try to delete this button and insert new button
 
Best regards
Adil Fazal
0
 
anyoneisSoftware DeveloperCommented:
Have you changed screen resolutions or Font Size recently?

David
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

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

Regards

Ian
0
 
MyersACommented:
HI meyerc74,

Did any of these solutions work?

Vaughn
0
 
meyerc74Author Commented:
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
0
 
meyerc74Author Commented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.