The Sample provided is very difficult to understand, and please also me with how can i display my windows form page in navigation drawer when some one click on menus,
i have 4 pages and that should be displayed as per menu selected, also my navigation bar is not coming proper i have attached the screen shot,
.and when i select the property fill, navigationdrawer does allow me to do branding in title ,
please help me with it
this.navigationDrawer1.DrawerWidth = this.Width / 4;
this.navigationDrawer1.DrawerHeight = this.Height;
|
this.navigationDrawer1.Items.Add(drawerMenuItem1);
this.navigationDrawer1.Items.Add(drawerMenuItem2);
this.navigationDrawer1.Items.Add(drawerMenuItem3);
this.navigationDrawer1.Items.Add(drawerMenuItem4);
this.navigationDrawer1.Items.Add(drawerMenuItem5); |
this.navigationDrawer1.ToggleDrawer(); |
i have a forms with different field
when i try to add a form ie form1 f = new form();
this.navigationDrawer1.Container.Add(f);
the following code gives me an error
also tried
this.navigationDrawer1.ContentViewContainer.Container.Add(f);
gives the same error
System.NullReferenceException: 'Object reference not set to an instance of an object.'
its difficult to write code for each control so i am drawing my control on other form and want to show them in in navigation container
//Create Object for different Forms
Home home = new Home();
People people = new People();
Photos photos = new Photos();
Profile profile = new Profile();
About_us aboutus = new About_us();
home.TopLevel = false;
home.AutoScroll = true;
home.Text = "Home";
home.Show();
home.Dock = DockStyle.Fill;
home.MinimumSize = this.Size;
people.TopLevel = false;
people.AutoScroll = true;
people.Text = "People";
people.Show();
people.Dock = DockStyle.Fill;
people.MinimumSize = this.Size;
photos.TopLevel = false;
photos.AutoScroll = true;
photos.Text = "Photos";
photos.Show();
photos.Dock = DockStyle.Fill;
photos.MinimumSize = this.Size;
profile.TopLevel = false;
profile.AutoScroll = true;
profile.Text = "Profile";
profile.Show();
profile.Dock = DockStyle.Fill;
profile.MinimumSize = this.Size;
aboutus.TopLevel = false;
aboutus.AutoScroll = true;
aboutus.Text = "About us";
aboutus.Show();
aboutus.Dock = DockStyle.Fill;
aboutus.MinimumSize = this.Size; |
A Navigation Drawer is used to navigate the pages and show the page inside the navigation drawer container,
the below solution you provide it opens a new form and once the forms are closed the navigation drawer stop working, and he is not able to open the forms again,
my query was i want to keep navigation drawer a parent and forms as a child pages and they should be added to navigation drawer space
i did few manipulations and my problem is solved, thankyou for the support
i get the below error whenever i close the form which have navigation drawer,
can you please help over it