This is only an issue if you have Drop Shadows turned off in appearance settings.
I noticed some of our applications form windows had no borders. Specifically they have been missing the 1 pixel thick border for the left part, right part and bottom part of the form window. All of the forms had in common that they were using FormBorderStyle FixedToolWindow or SizableToolWindow. When it is like this it is hard to distinguish where one dialog stop and another one begins.
We find it plausible that some of our users will have their computers set up like this without the ability to change it.
Is there a way to get the dialog windows looking better without doing anything crazy like manually drawing all borders?
Quoting part of a comment by Hans Passant:
By design for Win10, the left/bottom/right borders are transparent. Still quite visible against the large drop-shadow, so visible that is hard to tell that the border is transparent...
Our application has its own grahpical style that made it especially hard to distinguish where one dialog stops and the other one begins.
The quick solution for us was to stop using FormBorderStyle FixedToolWindow or SizableToolWindow.
Long term we are going trough all our dialogs and the graphical style of our application to make the dialogs more easily distinguishable from each other with or without borders.
Related
For a while now I have attempted to get into UI design with WPF. My main goal is to create a good-looking application in a borderless window, like for example:
I made this example using the MetroUI framework. While this framework does the trick on borderless window functionality, it also does way too much for my tastes, custom controls, skins, animations, etc. I just want a borderless window and decide everything else myself.
I've searched stackoverflow a lot, and tried a fair amount of frameworks, but nothing seems to suit my needs.
Basically, I would like to have a borderless window with FULL windows functionality (drag to sides to pin, only show shadow if operating system settings has it on, etc etc).
Putting WindowStyle to None but keeping AllowsTransparency at False in order to preserve the original window chrome makes most if not all of the functionality I am seeking for work. However, the obvious problem here is: the window chrome is still there.
This looks like this:
To finally ask my question:
Can we keep all the current functionality that this window chrome provides, but somehow make it invisible (yet keep the dropshadow it provides) ? I can live without the dropshadow but it would be a nice bonus.
Or to ask a more broad question: is there any framework / pre-made project, that simply ONLY handles making a borderless window work properly and no other additional controls, skinning, ... ?
The more time I put into this the more it seems making borderless windows with WPF is simply incredibly clunky and I am getting rather unmotivated on my entire project because of this.
Thank you
See my answer on the following thread, it pretty much sums up all the window issues at once. Hope it helps!
WPF Borderless Window issues: Aero Snap & Maximizing
I am currently developing an application on c# Visual Studio 2010 that simulates the performance of several machines in a factory. One machine can be either paused or running. My interface is a tableLayoutPanel whose components are also table layout panels each one representing one machine.
I want there to be a distintction between machine that are running or paused, so I was thinking maybe that the tableLayoutPanel of all the machines that are paused could fade out to black a little bit so that it is clear to the user. There is another option that i was thinking about which is overlaying a big pause symbol over the region of the machine.
For the first idea I have read about the Opacity attribute of the Forms class but it only works for Form components, and it renders the window transparent instead of just dark, for the second I am not sure what to use or how to look.
Does anybody have an idea of what I could do? I am new to VisualStudio so excuse my ignorance!
thank you
José
To be honest in my opinion the standard way to indicate a control is dormant is to set it to be disabled.
For your second idea, if you really wanted to go that way, you could create an object which shows a Pause button on top of your layout panel, and hide/show it when you want to indicate it is paused I suppose, although it may look a little clumsy.
Simpler might be disabling all the controls associated with a machine when it's paused and just adding a row/string to your table layout with "This Machine Is Paused" in red or something?
Now Im customizing title bar of my application. My aim is to add one extra button on title bar. Im my previous question people have adviced me the way I can customize non client area. Thats works perfectly except one small thing - glowing! I can draw glowing in nonclient area but I cannot make it spreads out of the window. I also cant find any resource about this subj.
I looked into this sample and made my own test app for investigating non client drawing facilities. Screen shot of my app's window:
So you can see that system button glows out of the windows when my is clipped by borderframe.
For example, Skype's window have four custom buttons in title bar and they can "glow" out of the window frame:
Can anybody advise me to find out the way to draw button's glowing out of the window?
Thanks in advance!
[EDIT]
Thank you everybody for answers!
Skype cheats it, and has a little sliver along the top of their window; where they can draw it.
You can see it with Process Explorer to SpyXX:
See also
MSDN: Custom Window Frame Using DWM
I don't think it's possible to draw beyond your NC area, and I kind of doubt they are drawing the whole UI to exactly match DWM Aero effects.
Given how this looks, I wonder if they did some tricks with either the help or restore button of a CustomBorderForm, which would then get the DWM blur highlight effect "for free".
Here's the most relevant article I could find to this: http://geekswithblogs.net/kobush/articles/CustomBorderForms3.aspx
Followup - I think this custom chrome thread has more pointers to the same techniques (although different goal): Custom titlebars/chrome in a WinForms app
AFAIK, this is not possible, because the area outside your window's border simply does not belong to you.
The Skype screenshot is from a custom-drawn frame that most likely extends a bit beyond the visible borders, not from an Aero Glass frame. You can tell the difference if you look carefully.
OK, anyone can explain how Jing take screen shots with that overlay form? It appears that it take a full screen shot and records all visible window handles and let you select within the form a specific hwnd. could be true? if is, what are the big steps to achieve this? could be a simple picturebox or without a custom control i don't have a chance to freeze the screen while taking a screen shot?
Thank you!
I'm not familiar enough with Jing to know exactly what it uses. But there are two basic techniques. One is as you mention, capture the screen and display it in a topmost borderless form. The Vista/Win7 Snipping tool works that way. You'll find the code you need to get this started it in my answer in this thread.
The other, perhaps more likely to be used by Jing, is similar to what Spy++ does, allowing the user to move the mouse and draw a selection rectangle around the window. Its advantage is that it can deal with windows resizing or disappearing while you've got the tool running. You implement it by using a topmost form the size of the screen that has its TransparencyKey property set to the value of the BackColor. Fuchsia is a popular choice. You can draw on this form with the OnPaint() method, the drawing appears on top of all the windows. You'd need some P/Invoke (GetWindow) to iterate the underlying windows in their Z-order to know which window the user is pointing at. GetWindowRect() to get the window rectangle. Plus some hassle to deal with Aero lying about the border size.
You can find sample code to get you started on that technique in my answer in this thread.
I would like to remove the resizing border from my WPF custom window.
I already found that I have to handle the WM_NCCALCSIZE message and return 0.
That removes the border and aligns the window to the top left corner of the window.
The problem is that by doing so, the client area increases and the WPF root control doesn't.
That creates black edges on the left and bottom sides of the window that I would like to get rid of.
I'm using VS2010 C# Windows XP and would like this to work under both Windows XP and Windows 7.
Thanks in Advance.
EDIT:
I found out what is causing the black edges, they are the window behind.
Now it seems that the problem is with the root element of the window not occupying the whole window. When I set its margin to negative values it draws over the black area. Apparently the layout pass is ok and the desired size is the same as the window but the render size is different.
I also found out that the whole problem could be solved by removing WS_THICKFRAME from the window style. The problem with that is the resizing functionality that is enabled only when WS_THICKFRAME is used. I'm using WM_NCHITTEST to do the resizing and if the window knows it doesn't have a resizing border, it will shutdown its resizing functionality.
I would like to make the root element occupy the whole window to eliminate the black window background or alternatively enable the native resizing functionality without the thick frame.
Thanks.
I found the reason for that black area.
It appears that the code I was using that someone else made was causing the black area by somehow messing with the layout pass of the framework and therefore the correct size of the root element.
I handled the WM_NCCALCSIZE in another project and it worked like a charm.
After all of that, although I found the idle way to create a custom window with all of the original window functionality, I decided to use the standard window the Microsoft has to offer so that my program will have future compatibility with windows.
If someone would like the code or help with WPF window customization they can comment here and I will help so that at least all of my research won't go in vain.
Thanks for reading.