Solved

WPF Dock Panel - Stretch file menu

Posted on 2013-06-23
5
862 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
  • 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 62

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 62

Expert Comment

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

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

13 Experts available now in Live!

Get 1:1 Help Now