Windowless WPF Application [duplicate] - c#

This question already has answers here:
How to create a WPF Window without a border that can be resized via a grip only?
(5 answers)
Creating transparent background in WPF
(3 answers)
Closed 9 years ago.
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,

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.

Related

Location of controls different between designer and run [duplicate]

This question already has answers here:
How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?
(6 answers)
Closed 2 years ago.
Does anyone know why the location of some of my controls is different between designer and run mode? It's driving me nuts. In designer they are all in the right location, anchored as should be, but when I run the application, the form is somewhat resized but the controls don't move accordingly. The ones on the outer right are all somewhat hidden, and resizing the form in run mode does not improve this as they are anchored.
Thanks
Designer view
Run view
Configuring the application to use the correct dpi setting was the solution. Thanks Jimi! :)

C# Mouse Movement Outside Form [duplicate]

This question already has answers here:
Mouse movement capture
(3 answers)
Closed 9 years ago.
I am trying to track mouse movements in my code. It's easy to track mouse movements in form window but i wanted to track mouse movements outside of my from window. i mean i will minimize my from to tray and track where it is. Any idea how to track mouse movemtns outside of my form windows with sample codes or sample explanation links? I am using c# and i would like to know how. Thanks for your help.
For form windows i tried this link and it works perfectly.
What i want.
I want to get to know when user move mouse left to right or right to left and show message about warning.
I want my application as a service (actually its not so neccessary if you can help on form application it will be fair enough too) and startup with os. and track mouse movements and catch if user move his/her mouse left to right or right to left. Thats it. I hope this edit will be very specific explanation.
To do this properly, I think you will need to use global hooks. This seems nice and is C# managed code.

Disable right click wpf [duplicate]

This question already has answers here:
Disable a right click (press and hold) in WPF application.
(2 answers)
Closed 9 years ago.
I am building a wpf app for a touch screen for windows 8 and I need to disable touch&hold (the equivalent of right click). I have read at the remarks on this link http://msdn.microsoft.com/en-us/library/system.windows.uielement.previewtouchdown.aspx that pressing a finger on the screen and holding it without moving it causes the press and hold behavior of a Stylus. Unfortunately, right click was not disabled by setting Stylus.IsPressAndHoldEnabled="False" in the XAML.
Could you please help me disable it? Thank you in advance :)
You can write event handler for OnPreviewMouseRightButtonDown event and set the value of isHandled to true.

How to show the form with the desktop background dimmed? [duplicate]

This question already has an answer here:
C# Best Method to Dim Screen, Multiple Windows Forms?
(1 answer)
Closed 9 years ago.
I want to show the winform to be displayed, however the form would be in the normal state (not maximized). However, i want to dim the desktop background to be dimmed for user attention.
Maximized form with background dimmed is an option, but i don't want to maximize the form.
Maximized form with background dimmed is an option
Firstly if the form is maximised, then there is no point in doing anything with the background as it cannot be seen.
i want to dim the desktop background to be dimmed for user attention
This is messing with the OS settings, and I am not even sure if it is possible and it is certainly not desirable. I, as a user, would never want an application messing with my other running programs or my OS settings/preferences.
In short what you want is not possible (at least with out some nasty code) and it is not good practice.
I dont think you can change the background, as well as I dont think you should.
I'd try to open "maximized" form with large opaque (or half-transparent) border.
May be this will be helpful

C# disable aero snap for WPF window [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
disable Aero Snap (wpf)
I have an application in C# WPF. I want the main window to have fixed size. To achieve this, I have set the height and max height, width and max width, to the same values. Everything looks fine, but I want also to disable Aero snap effect for this window only.
The solution to disable Aero snap from Windows Registry or Control Panel is excluded.
Setting the ResizeMode of the window to "NoResize" is also excluded, because in this way the window border dissapear too.
Do you have any working solution for this problem in C# ?
Thank you very much.
You can try to change the ResizeMode to NoResize only temporarily as explained in this answer.
Otherwise you can try this trick also but I haven't tried it myself.
I have finally found a solution, after 2 days of searching all over the Internet.
http://programminghacks.net/2009/10/19/download-snapping-sticky-magnetic-windows-for-wpf
Unfortunately it does not work with borderless windows.

Categories

Resources