Get a Windows Form to behave similar to a taskbar - c#

I've got a problem (well, rather no clue how to do something) about my Windows Form.
I have set up a windows form that, much like the task bar, goes from the left to the right of the screen. Now I would like it to, instead of being "above" other windows, "push" them down / make them smaller so they fit between a sort of "top-task-bar" and the normal taskbar - here you have a screenshot of what it looks like right now:
As you can see, it's in the way of other programs' controls etc.. Since I would like it to stay TopMost, I have to do what the task bar does - decrease the working area so programs have no problems but it's still there. I'm using Windows Forms.
Any advice on how to achieve this?
Thanks!

Related

How to create moving toolbars in windows form C#?

Backgound :
I want to create moveable toolbars just like paint.NET or any other Designing application. A Toolbar which can be moved, closed and shown from the menubar.
i know how a toolstrip works but its permanent sort of thing. There is another way explained in some articles which uses panels to make toolbars.
While doing experiments on the toolstrip, idea came up in my mind to make two forms(one big size form and other small form) and run them simultaneously , one will act as main form and the other small form will act as a toolbar but it also didnot work. I am only able to run one form.
Requirement:
I just want to make an application look like Paint.net having different tools in a toolbar which can be used on drawing area.and when application starts, toolbar and drawing area both should be running just like in all graphics editing softwares.
Questions:
How to make a moveable toolbar that can be closed and viewed again?
How to run two forms of different sizes run simultaneously at the same time when application starts?
Note:
Need Guidance as well if i am not in the right direction, u can set my direction towards the right side.
Thanks

Windows 7 forms effect - how to switch it off?

I have a form, originally developed to be used on XP, containing a .NET 4.0 ProgressBar control. It's part of a composite control, where I write some info on top of the bar using TextRenderer. (I didn't go for a label, because the transparency doesn't seem to work.)
I've now upgraded the OS to Windows 7, and it seems the whole look and feel of the controls has changed. The progressbar now has a kind of "swoosh" effect, a highlight that moves quickly from left to right. The problem is this animation is removing my rendered text. My app happens to update often, so the result is a blinking text on top of my status bar.
How can I fix this?
Any reason you have to write the text superimposed on the bar itself instead of underneath it, as everything else does? It sounds like it would be a lot easier to read the text if it were separate from the bar. That's certainly been my experience of progress bars as a user: keep any status messages away from the graphics.
EDIT: I've just checked, and if you don't call Application.EnableVisualStyles it uses the very old "big blue blocks" style, as far as I can tell. Personally I find this pretty ugly - I'd recommend that you stick with the nicer visual style, but move the text.
If you want to go all the way, you can remove calls to the Application.EnableVisualStyles method, which enables "colors, fonts, and other visual elements that form an operating system theme."
Visual Studio typically adds a call to this method in the Main method of a WinForms application.

C# WPF DragMove without Window_LocationChanged()

I implemented something in Windows Forms similar to DragMove but with boundaries set to 10 units of the margins of the primary screen.
When switching over to WPF I found this thread to be useful in achieving the same result.
However, since this is a post-move event, what happens is that if my window is dragged beyond the boundaries I set, it "jumps" back. I would like to avoid this effect as it looks terrible.
Is there a simple way to avoid the window to be moved outside a given area without using the LocationChanged event? I basically want to restrict the movement of the window before it happens.
These this are very hard to achieve with WPF because it does not expose the base Win32 functions and events like WinForms did. I had a project where I needed to to resize a window and I had to use PInvoke SetWindowPos to do this in a normal manner.
AddHook may help you, but this will still be quite difficult. See http://www.wpfmentor.com/2009/01/how-to-get-hwnd-and-hook-into-wndproc.html and http://msdn.microsoft.com/en-us/library/system.windows.interop.hwndsource.addhook.aspx for more information.

Winforms Minimization Techniques

I am trying to make my application "flip" when the minimize button is pushed. By flipped, it should be kinda like a coin when flipped. It "flips" down into the taskbar. I am wondering how effects like this are accomplished in WinForms using C#. Can this be done or does something like this need to be done using DirectX?
You could P/Invoke AnimateWindow() to get effects like this. Visit pinvoke.net for the declarations you'll need. Beware that the novelty of this wears off very quickly, definitely make it a user-selectable option.
I don't know, but you can control (including animate) what's displayed within your application window. Doing what you want may therefore require you to animatedly move your window towards the taskbar, while flipping its contents.
This isn't something that WinForms natively supports. You could attempt to "simulate" a flipping window by shrinking the width of the form slowly to 0 and then growing another form at that location to the proper size that looks like the "back" of the window.
But there isn't anything like animations or transitions in winforms. You need to go to WPF for that.

Closing Windows Forms on a Touchscreen

Our clients have fat fingers, and so do we. We take touchscreen netbooks apart to insert them into our custom hardware, and I write a software interface that shows up on the touchscreen. The problem is that it has about a 3/4" bezel over the screen, which means hitting that little red "X" becomes a challenge, especially considering reduced capacitive ability on the edges and corners.
Is there a way to make this standard close button larger? Of course in the application I can always make really nice 80x80 buttons that are perfectly usable, but there seems to be no way to override the default frame of the form. We have tried enabling Large Fonts and all the built-in accessibility features, but nothing seems to make it large enough to hit successfully.
Simply adding a toolbar button is also not much of an option. We prefer to utilize the standard look and feel of a normal Windows application.
Alternatively, should we be looking at making some sort of "kiosk mode" where we simply go fullscreen and do nothing involving the taskbar or title bar? How difficult is this to accomplish, if so?
Well, since you're setting up the hardware, I presume you're able to configure preinstalled software, including Windows. Can't you just go into Display Settings and make the title bar larger, so that the close button grows accordingly?
See MS Article about distributing windows themes: http://support.microsoft.com/kb/310514
Getting a large close button is fairly easy to do. It is hidden well since Vista, in Win7 it is Control Panel + Personalization + Window Color, Advanced appearance settings, Item = Caption buttons, change the Size. You probably won't like this much though, you'll get a rather large caption bar, lots of waste screen real estate.
Tackling this from the other end: your request is unusual. Most anybody that sets up a touch screen app wants to know how to prevent the user from closing the window. Windows Forms makes it too easy to design a bunch of forms and switch between them. That isn't much of a user interface on a regular desktop, especially not here. You can design your forms as user controls as well and switch them in and out of the main window as the user navigates through the UI. Not unlike, say, Microsoft Outlook. You can even turn your existing form into a control. Set its TopLevel property to False, FormBorderStyle to None, Visible to true.

Categories