Delete Close button in WPF window [duplicate] - wpf

This question already has answers here:
How to hide close button in WPF window?
(23 answers)
Closed 9 years ago.
I am trying to delete "X"/ Close button on the right side of the WPF window. I tried researching a lot about it on internet and came across 2 methods of doing it.
Completely removing the title bar by using GetWindowLong and SetWindowLong using solution posted in this post.
How to hide close button in WPF window?
Problem - this method removes the complete System menu(buttons of right side + Icon on left side) and I don't want ICON to disappear.
Used GetSystemMenu,RemoveMenu
Problem - this method only disables/grays out the X button although it keeps the ICON but doesn't remove the X button.
Can someone please help me with this issue?

You need to create your own chrome, add the buttons for minimize, maximize, close, etc, and disable the close button. You need to provide code for all the other functions, such as dragging area, context menus for moving, etc. Not too much and it will get you exactly what you want.

Related

Moving to next control on button click in WPF [duplicate]

This question already has answers here:
Moving to next control on Enter keypress in WPF
(7 answers)
Closed 8 years ago.
I want to move to the next control when I click the button instead of the Tab key in a WPF MVVM application. How can I achieve this?
You question seems not clear. But to set focus on a control you can do this
controlId.focus()
However, check out Moving to next control on Enter keypress in WPF, it could be of help too

WP Panorama View

I have a Windows Phone 7 application that is in Panorama view. It has a menu (let's say item 0) and 4 other "pages", known as items. The entire panorama is considered one page, so each view are called items.
My question is that how am I able to slide to items 1,2,3 & 4 with the cool sliding transition when a button is pressed in the Menu ? Another question is that how am i able to use silverlight, i installed it but it doesnt appear anywhere.
I used this code
panoramaControl.DefaultItem = panoramaControl.Items[1];
but it gives a very sucky transition, of just appearing. I tried using storyboard but it doesnt give the sliding transition.
There is no way in code to animate the transition from one PanoramaItem to another. This is because the control is not intended to be used in this way. The DefaultItem property is intended to be used to set the item shown when the page is [re]shown.
Your other question "how am i able to use silverlight, I installed it but it doesnt appear anywhere[?]" doesn't make sense.
If you've got as far as creating a project with a Panorama control then you are using the Silverlight project templates.

WPF Windows 7 Lock Screen Buttons

In Windows 7 (and Vista, if I recall correctly), when you hit CTRL+ALT+DELETE it takes you to a pre-lock screen such as the following:
I am looking to find a way to recreate the buttons on this screen (Lock this computer, Switch User, etc.) for an app I am working on. I need to be able to specify what the left-hand side image is since all of mine won't be arrows. Does anyone know where I can find a style that mimics how this looks/behaves?
Also, if there is a way to also come up with a button style that mimics the Cancel one that would be awesome.
Follow this tutorial and you should get the cancel button style. And for the other buttons you can create a button ControlTemplate with a StackPanel containing Image and TextBlock.

Win32 - Contents in tab control disappearing when dragged off screen

I am using resources with Win32 to create a dialog containing a single tab control. The tab works fine when changing tabs but somehow dragging the window off screen ( eg. dragging it past bottom of screen then back up ) will cause the tab contents to disappear. I think it may be a problem with how I've set the clipping properties but after much fiddling I still didn't get it working exactly how I expect.
I have uploaded a basic skeleton project here which has the bare minimum required to reproduce this problem and would be very grateful if someone could check it out.
http://localhostr.com/file/nPTbTTQ/skeleton.rar
It is a Z-order problem, the dialog is behind the tab control. Change the parent of the inner dialog from hwndDlg to hwndTab. I don't want to guess why you saw the static control text at all.

Windows Forms YesNo Message Box - Buttons Text [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to change button text for Yes & No buttons on MessageBox.Show Dialog?
In a Windows Forms application I have a MessageBox with YesNo buttons. I want to change the text on the buttons (from "Yes", "No" to something custom).
If I were you I'd create my own MessageBox dialog. It's not that hard and I'm sure you'd be able to do this faster than hacking the standard MessageBox.
Your only possible "customization" with the winforms MessageBox is to use the MessageBoxButton enumeration when creating the MessageBox.
It is fairly limited, so looking for a third party message box or creating your own dialog box may be a better choice.

Resources