Solved

WPF Dock Panel - Stretch file menu

Posted on 2013-06-23
5
933 Views
Last Modified: 2013-06-23
I try to create a WPF Menu and dock it on top in Top WPF DockPanel.   However when I stretch the window, the menu is in the middle top of the window rather than stretch across  the length of the window.  How can I make the menu to stretch across the window.
Capture.JPG
0
Comment
Question by:tommym121
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:tommym121
ID: 39269212
I forget to attach the code. This is the code:

           Menu menu= new Menu();
            menu.HorizontalAlignment = HorizontalAlignment.Left | HorizontalAlignment.Stretch; ;
            menu.VerticalAlignment = VerticalAlignment.Top;

            DockPanel.SetDock(menu, Dock.Top);
0
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 39269294
Hi tommym121;

What happens when you do this instead of the line you are using.

 menu.HorizontalAlignment = HorizontalAlignment.Stretch;

Also are you setting the Height and Width on the Menu control?
0
 

Author Comment

by:tommym121
ID: 39269339
Thanks.  I set the width too.
0
 

Author Closing Comment

by:tommym121
ID: 39269340
Thanks
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39269343
Not a problem tommym121, glad I was able to help. ;=)
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

630 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