Silverlight OOB - own chrome with Windows 7 docking behaviour - c#

I'm creating Silverlight OOB application with its own chrome (title bar, minimize, maximize buttons and so on). I've implemented the resizing functionality and everything works quite good.
Still I would like to add one more functionality. I would like that my app has good docking behavior in Windows 7 OS - maximizing on docking to the top of the screen, changing size to the half of the screen on docking to right or left.
How can I do this? I will be appreciated for any help.

Related

Can you get the Windows 11 style menus/buttons etc... in WPF?

I am currently developing a small WPF application.
I have noticed that, especially in Windows 11, the Button and Menu controls look noticeably dated. Win 11 brought rounding to all of these, but WPF seems to be using an older, more square, styling:
Typical rounded button in a Win11 application vs. the default look of the <Button/> control in WPF:
This also applies to the <Menu /> - if we take a look at a typical program's menu UI styling under Windows 11 vs. the style in my WPF application:
Why does WPF have these different styles? I have been reading around and there's lots of mention about adding a reference to Microsoft.Windows.Common-Controls in app.manifest but this doesn't seem to have made any difference to these controls in my case.
What's more confusing is that the actual WPF window itself has rounded corners, and the context menu for right clicking the title bar of this window is using the new style - it seems to be controls inside the window that are plagued with the older styles.
Any help/info would be much appreciated!
WPF is officialy dead. That's probably the reason it doesn't receive new features, like the new theme (and more than 60 fps, stereoscopic rendering or native DirectX 12 without a picture buffer to transfer to DirectX 11 in WPF). Those other apps are using the Windows API for GUI, so they don't need to be even recompiled to get the new design. WPF is drawing GUI on its own, so it would need a not-so-small update, which is not economical.

How to disable touch scrolling in WinForms for Windows 10?

Years ago we have developed a WinForms application that was running with Windows 7, but should now run with Windows 10. This application is used on touch screens.
In Windows 7, the user could only scroll DataGridViews and other things using the scrollbar. Since this application is running with Windows 10, the user can also scroll these controls by swiping/dragging the control.
However, we don't want to change the behavior of this application now it is running with a newer Windows version, so we don't want to have this 'touch scrolling' functionality. Only the scrollbars may be used to scroll.
WPF has better touch support for these kind of things (PanningMode on ScrollViewers etc.), but unfortunately we can't migrate this application from WinForms to WPF.
So is there a way to disable this touch scrolling in code for WinForms? Or can it be disabled system wide with a Windows 10 setting or somewhere in the registry?
Thanks!
A colleague found a solution.
In the registry, find key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Wisp\Touch\PanningDisabled and set it to 1. Without rebooting, swiping will be disabled.

Transparent Window in .NET

is there any way that winforms or WPF can do this kind of UI? transparent with blur window.
A forenote: Windows 8 removes the Aero Glass effect. Windows will appear with a solid background where there would be glass (like how they appear on Windows 7 when you disable the glass effect but still run the DWM).
That said, the effect is done using Win32's DwmExtendFrameIntoClientArea function. Using this in your program differs depending on whether you're using WPF or WinForms (as WPF windows do some pretty interesting window subclassing, and of course, WPF controls are largely windowless).
To get a "whole glass" window, you just use the DwmExtendFrameIntoClientArea function to fill your window, rather than just the first 50px or so, which is what IE and other browsers do.
This is the canonical MSDN article on how to do this with WPF: http://msdn.microsoft.com/en-us/library/ms748975.aspx
For WinForms, see this blog article: http://blogs.msdn.com/b/tims/archive/2006/04/18/578637.aspx
Enjoy, but not for long considering Windows 8...

WPF application that claims desktop real estate similar to windows taskbar

I'm building a WPF application that is designed to act as a notification toolbar for sending messages to users of an enterprise software platform. It's a bar that is a specific height, stretching all the way across the bottom of the user's desktop, sitting directly above the Windows taskbar.
What I'd like to do is to have my application "claim" or "reserve" the space it takes up and not allow any applications to load behind it. For example, if you were to resize your windows taskbar and make it larger, it will move icons and shortcuts, and maximizing windows will only use the desktop area that is not already being used by the taskbar.
Any idea how this could be pulled off? It's already set to be the topmost item on the desktop, so that's not my question. Right now if you opened another app and maximized it, then the bottom X pixels will be hidden behind my toolbar application.
(Note that I've added Windows 7 and Windows XP tags - I'd love to be able to implement this functionality on WinXP and up, but if I'm not able to do so on a particular version or versions, I can come up with a workaround)
These are called AppBars in Windows and you can use the SHAppBarMessage function to "dock" your window to a side of a monitor. Then other windows, when maximized, will not obscure the docked window.
Here's a link to a similar question that has more information, including a link to a CodeProject page that walks you through creating one.

WIndows Mobile full screen problem

I have a windows mobile professional 6.1 application and I want it to be full screen in all pages so I put the code below into my every pages constructor;
this.WindowState = FormWindowState.Maximized;
this works OK but "sometimes" for example when I use
MessageBox.Show("alert");
or when I try to connect internet within application and there is a problem and Windows shows me some messages popping up from the top of the screen..in this cases I lose my full screen and the top menu bar of windows becomes visible again..
any ideas?
You can use SHFullScreen to hide the start icon and other system areas of the screen. There is an undocumented function named AllKeys which will allow you to block some of the hardware keys (notes, recorder, green + red phone keys) from running. It will require a lot of work because there are many ways to run programs and the taskbar has a habit of reappearing after a program is run. Simply calling SHFullScreen once is not enough. You'll have to handle WM_ACTIVATE messages and call SHFullScreen again and force your program to the top again. It's a struggle against the operating system to have a true kiosk application on Windows Mobile.
Getting an app to "kiosk mode" in Windows Mobile is challenging becasue the platform simply isn't designed for it. This page has a lot of links to resources of getting it working. Using your favorite search engine to look for "compact framework kiosk mode" is likely to bring up more as well.

Categories