Simple WPF Control Questions
Just ran into a bunch of random but probably very simple questions while learning to work with WPF. If anyone can answer any of these it would be most appreciated.
I have a
Rectangle
that I styled to my liking, and then aStackPanel
that I am actually placing the content (bunch of labels) in. It looks likeRectangle
doesn't have a closing statement so how can I make it the parent of theStackPanel
(I want the panel to move with it)?I need to display text (labels) in a table form. It will only be two columns, and 8 rows (row count may change). I initially looked into just using a
Grid
, bu开发者_开发问答t as this is a intended for Layouts, it didn't work as expected. I also checked outDataGrid
, but this seems confusing and overly complicated for my needs. Is there any simple Table style element I can use?I have some Animated Expanders and I want to give the other UI content elements in my application a similar looking title bar. I haven't seen any sort of element for this, so I am wondering if I just need to use a
Label
or something and style it as close as possible to match, or if something already exists that I should use instead. If I need to use a label, what is the proper way to group/attach it with the element that it is the title bar for?Do any controls exist for WPF that would allow for a Mac style menu bar? Something similar to
where the icons move and expand as they are mouse over.I have a grid that has two expanders (one above the other) with
Height="Auto"
, and two rows set toHeight="Auto"
so that when the top is minimized, the bottom one moves up to close the gap. I am using aMinHeight
right now to make sure they are at least somewhat expanded, but I would like to make them take up the full 100% of theGrid
height. What should I do for this?
A rectangle cannot have child content, a better approach might be to use a Border, you can use this as that parent of your stackpanel, applying a Background and BorderBrush to make it look like a rectangle.
For a simple table layout Grid is the way to go. Is your problem that you need it to be dynamic? If so, you can create multiple grids with SharedSizeGroup on the columns to make them look like a single grid. See: How to align separate Grids created via templates along their columns / rows?
Learn about creating your own templates!
Not that I know of, but it would be relatively simple to do, create a storyboard that scales the item on mouse over.
No idea ... running out of steam!
As Andrzej Nosal mentioned, these really should be separate questions!
精彩评论