Solved

WPF Dock Panel - Stretch file menu

Posted on 2013-06-23
5
909 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need to sort columns in DataGridView 4 64
Dictionary and array of [N] size - performance tuned 12 52
Set custom font WPF 2 26
.NET Redemption/Outlook Examples 3 34
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…

751 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