5

I am hoping someone can point me in the right direction here. I am trying to turn my analog clock application into a windowless clock. I have searched google but I think my issue is I do not know the correct term for what I am trying to do.

My analog clock application is a circle that contains the clock hands. This is contained in a window like most other applications. I would like to remove the window and have only the clock show above the background. I would be able to bring up the close button maybe on mouse over. Or perhaps I could make the whole window transparent except for the clock and on mouse over I would be able to see the window and close it.

Anyone have any experience on this? Maybe some tips or a tutorial somewhere?

Thank you,

scott lafoy
  • 1,001
  • 1
  • 13
  • 30
  • Please define "windowless" - because anything that displays itself on-screen has to have a parent window - granted it can be a "frameless" window without the titlebar and borders and with a non-rectangular shape - is this what you're talking about? – Dai Mar 25 '13 at 16:39

1 Answers1

9

You can build your Window, and set the Background="Transparent" like so:

<Window ...
   AllowsTransparency="True" 
   WindowStyle="None" 
   Background="Transparent"  >

This gives you a window with a transparent background and no border.

Reed Copsey
  • 554,122
  • 78
  • 1,158
  • 1,373
  • I don't know if it's still the case but this used to cause my app to drop in to software rendering mode, might want to check that. – Andy Mar 25 '13 at 16:48
  • @Andy It shouldn't do that - that should only happen if your card can't handle things properly (ie: you're in XP and don't have WDDM and the DWM, or on a crappy graphics system). – Reed Copsey Mar 25 '13 at 16:51
  • That's totally possible it was running on a very poor machine – Andy Mar 25 '13 at 16:53
  • I gave this a try on my clock app and it works exactly as I wanted. it is a lot simpler then I expected it to be. It doesn't seem to be able to handle turning the window back on with a mouse over event, so this is where I will have to do some work. Thank you for your help. – scott lafoy Mar 25 '13 at 17:21