Clickable Screen overlay in C# - c#

I am looking for some technologies or ways to create an application which should work like an active (clickable) overlay.
Let's say that we have running application which is always on top. My idea is to create a section on the left or right side of the screen. I'll try to explain in the fast sketch below:
As seen from the image, not only I want to create overlay which is on top aswel, but I want to adjust screen size for "App running always on top"
Is something like that possible?
If so can you please navigate me to the right direction?
PS: My app should have some clickable elements like radio buttons etc.
Thanks a lot

I think you want something like the window that appears when you right click an icon on the Windows taskbar. This is just a Windows Form without titlebar (here you can read how to hide titlebar: https://stackoverflow.com/a/7483026/14940782).
Then, you can add Opacity or BackColor to the form to make it semi transparent or with some color you want. BackColor allows Transparent, by the way.

Related

Translucent windows form

The look I'm going for is like
where the sidebar is semi-transparent and the background can be seen through. However TransparencyKey only takes into account the pixels at the top, if there is another panel on top that means that together they do not fit the transparency key then it will be opaque.
I have the TransparencyKey set to Fuchsia and the grapefruit sidebar is on top and is changed to sidebar.BackColor = Color.FromArgb(128,255,255,255); on load.
As you see the TransparencyKey only works on the top.
I have also tried setting the transparency on the form with undesired results.
How would I go about making the sidebar translucent?
Solution v
You just can't do that in winforms. Period. It's an antiquated technology that doesn't support "real" transparency. Whenever you see the word "transparent", it really means your control will inherit the back color of its parent. It does not mean you can see things that are behind it.
You may be able to do it with WPF, though I'm not entirely sure.
As noted by #JeremyThompson WPF is absolutely fine at doing this.
Inside the window include WindowStyle="None" AllowsTransparency="True" Background="Transparent" and then use panels/canvases as normal.

Display Image on top left corner of the desktop

I want to display a very small image on the top left corner of the windows desktop, it will be a picture of a small note and when you mouse over it, the window will show.
How can I do this in C#?
There should be no borders or regular window graphics
The image will be partially transparent
When a mouse over event occurs a window will display
The image will always overlay other windows
Thanks
I'll try to point you to the right direction for each of those requirements, you can do more research on how to exactly achieve each one using google or stackoverflow.com
You need to create a widows form, and add the image as the background of the form, or add an image control to the form.
after you have that, you can use the following to get your desired effects.
No Border
Set form's FormBoarderStyle propery to None
Transparency
Set Opacity property of the Form to something less than 100%
Mouse over
Use MouseHover or MouseEnter events of the form
Overlay other windows
Set TopMost property of the form to true.

Blinking or glowing button in C#

I'm wondering how to create blinking or glowing "Alarm!" button/image.. For image -> one normal jpg, and one gif? Any easier solutions?
You might this useful - http://www.codeproject.com/KB/buttons/VistaButton.aspx
Easy way is to create two image files , one with the glow, another without it . When the app receives the alarm change the button image .
The buttons in Windows Vista and Windows 7 already glow and throb by default when the user mouses over them, and/or when one is set as the default button for a form. The effect looks like this:
If you're not getting this effect already, make sure that the FlatStyleproperty of your button control is set to "System".

transparency in windows forms C#

if the transparentkey property is used to make the top level form transparent,it works , but it also makes the main form click-throughable. I want the opposite of this, that the form becomes transparent, but is still able to recieve clicks. can this be done ?
Here is een solution. The form is totaly transparent and still clickable.
There is also
myform.Opacity = .75
.. which you can change as required. It may work better depending on your needs - you don't state whether its the whole form or only part of it you want transparent. Also, from MSDN on TransparencyKey:
Any mouse actions, such as the click
of the mouse, that are performed on
the transparent areas of the form will
be transferred to the windows below
the transparent area.
.. so it would seem that wont help you at all.

WinForms (.NET) Button Anchoring when Maximized

Ok, I have googled, but maybe I put my search in weirdly. :/
I have a VB.NET WinForms application. I have the anchor properties set for all the controls so that it will resize all the controls to look decent when the form is maximized. (Haven't gotten around to manual resizing yet however).
Anyway, the problem:
I go to set the same properties for a button (testing with a single button for now) on the main GUI form/picture. When I go to run the program via F5, it looks decent. But when I maximize the form, the entire button covers up more than it should.
I've taken screenshots of the form so you can see a visual of what I'm talking about. :/
Before: http://zack.scudstorm.com/before.png
After: http://zack.scudstorm.com/after.png
What other propert(y|ies) do I need to set for the buttons to show up correctly? :/ (The buttons go over the boxes that say, for example, "1-1", "2-3", etc.
Thanks,
-Zack
Seems like you have anchored top-left and bottom-right when what you want is just top-left.
Edit: If it's just an image that does not change when the winform changes, then don't anchor your buttons at all. Just put them where they go. If you are scaling the image, then I would either detect the clicks on the image and do the scaling math or do the scaling math and set my buttons in code in the Form.OnResize event.
As it appears that your goal is just to be able to handle clicks on the "computers"...
One option that can be useful for this sort of task is to create an "overlay" bitmap (not displayed, but which is the exact same size as your source bitmap) which uses different colors to represent all the clickable regions. (e.g. (R=0,G=0,B=0) for computer 0, (0,0,1) for computer 1, etc)
You could even generate this bitmap somewhat automatically without too much trouble (If you have a mode where you can click the top left and then bottom right corners of the image to define a new region)
When the mouse is clicked, you can check the pixel at the scaled coordinates of the mouse position in the overlay and determine what their click corresponds to. This can be a lot easier than creating loads of controls, and makes it a lot easier to have clickable regions that aren't rectangular.

Categories

Resources