Click here to Skip to main content
15,068,929 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is the code for ToolStripMenuItem item click event

private void manageUsersToolStripMenuItem_Click(object sender, EventArgs e)
         //"ManageUsers" is child form 
             ManageUsers _manageUsers = new ManageUsers() {
             MdiParent = this ,
             Dock= DockStyle.Fill,
             WindowState= FormWindowState.Maximized


But i'm still getting scroll bars :-(
I'm I doing something wrong??
RhishikeshLathe 21-Jan-14 23:32pm
where r u getting scrollbar?

I suggest to read this: About Scroll Bars - Scroll Bar visibility[^]

Have a look at WinForm AutoScroll[^] property which indicates whether the form enables autoscrolling.
A Form used as a MdiParentForm cannot have 'AutoScroll set to 'false: at design-time, if you set its 'AutoScroll to 'true, it will automatically set the the 'IsMdiContainer property to 'false. Setting 'IsMdiContainer to 'true will automatically set the 'AutoScroll property to 'false.

The only source of the Scrollbars you are seeing must lie in the fact that your MdiChildForm has 'AutoScroll set to 'true, and the child Form has content that exceeds the Bounds of the Form when it is displayed Maximized in the MdiParentForm.

Try adding
_manageUsers.AutoScroll = false;
to your code that creates the child Form.
set form border style of child,

FormBorderStyle = System.Windows.Forms.FormBorderStyle.None

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900