12

I tried setting WindowStyle="None" in XAML but that makes the Window completely borderless. I need a Window that does not have a title bar, which prevent user from moving it. But still has border so it still looks like a Window :)

khr055
  • 28,690
  • 16
  • 36
  • 48
sean717
  • 11,759
  • 20
  • 66
  • 90

1 Answers1

20

WindowStyle="None" does not remove the border by default, you must allow resizing (ResizeMode = CanResize / CanResizeWithGrip) and forbid transparency (AllowsTransparency="False") though as far as i know.

H.B.
  • 166,899
  • 29
  • 327
  • 400
  • It worked well. Thanks, it is possible to disable the resizeing at the same time? – sean717 Jan 18 '12 at 22:53
  • @sean717: Not sure, you could do a few overrides i suppose but it would still *look* like it can resize which is kind of a bad thing. I think microsoft realeased *something* to customize windows, maybe that would be a better approach. Maybe i can find it again... – H.B. Jan 18 '12 at 22:59
  • @sean717: [This](http://archive.msdn.microsoft.com/WPFShell), don't know if it's actually useful though. – H.B. Jan 18 '12 at 23:01
  • 2
    Thx H.B. I end up doing the trick of setting the MinWidth, MaxWidth, and Width to be the same. – sean717 Jan 18 '12 at 23:04
  • @sean717: That also has this limitation that it still appears to be resizable, but if that does not bother you, or rather if it does not bother you that the users will be bothered... – H.B. Jan 18 '12 at 23:11
  • Nah buddy that doesn't bother me at all. Nor it bothers me whether the users will be botherred or not (kidding). It only bothers me when my product owner is bothered :) – sean717 Jan 18 '12 at 23:44