WPF GroupBox Visibility

Page 1 of 1

2 Replies - 6380 Views - Last Post: 30 October 2013 - 05:03 AM Rate Topic: -----

#1 shers  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 30-October 13

WPF GroupBox Visibility

Posted 30 October 2013 - 12:49 AM

Hi

I'm working on a WPF desktop application. The MainWindow is a maximized window that has a menu with few menu items. I would like to display few controls within a groupbox on the center of the window. This groupbox contains controls depending on the menu item clicked. So the size of the groupbox should not be static. Is this possible?

Thanks
Is This A Good Question/Topic? 0
  • +

Replies To: WPF GroupBox Visibility

#2 MrShoes  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 331
  • View blog
  • Posts: 512
  • Joined: 13-June 12

Re: WPF GroupBox Visibility

Posted 30 October 2013 - 03:23 AM

Yes. In fact, if you have any explicitly-set sizes in WPF, you're doing things wrong. You should be using layout panels (such as StackPanel, DockPanel etc) to control the size of your controls.
Was This Post Helpful? 0
  • +
  • -

#3 tlhIn`toq  Icon User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6507
  • View blog
  • Posts: 14,377
  • Joined: 02-June 10

Re: WPF GroupBox Visibility

Posted 30 October 2013 - 05:03 AM

If you are dragging and dropping controls from the toolbox then margins and sizes get set by default.

For XAML try to avoid drag-n-drop. Just code it by hand, it actually is a lot easier and won't introduce anymore than what you type. There are two WPF for the Winforms coder tutorials linked in my signature block.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1