WPF - Hide minimize button of a window - wpf

In WPF, how can I hide the minimize button (only the minimize, not also the maximize...) of a window.
The code in this forum almost work for me. The behavior of that code is that it's disabled the minimize button. But, how hide it?
http://forums.silverlight.net/forums/p/222067/532926.aspx

How about disabling the resize attribute?
ResizeMode="NoResize"

I think you would have to hide the default window title and draw your own titlebar.
e.g.: C# WPF Custom Title Bar Tutorial
and Moving a WPF Window with Custom Chrome

Related

How to add a button to a window title?

I want to add to the title of a mainwindow in my WPF application a button.
I would also like to remove re minimize and exit buttons from there.
How can I do this?
Probably these links will help you:
Remove close button:
How to hide close button in WPF window?
Remove min/max buttons
How do I remove minimize and maximize from a resizable window in WPF?
To add a button to the window title you can use WPF customizable window control:
http://wpfwindow.codeplex.com/
Hope it will help you!

ToolTip versus Popup (WPF control)

What are the main differences between these WPF controls?
And when I should use a ToolTip instead of Popup?
A ToolTip is a small pop-up window that appears when a user pauses the mouse pointer over an element; the Popup control provides a way to display content in a separate window that floats over the current application window relative to a designated element or screen coordinate.
A Popup does not automatically open when the mouse pointer moves over its parent object. If you want a Popup to automatically open, use the ToolTip or ToolTipService class.
For more information see: ToolTip overview and Popup overview.
Previous tooltips in Winforms were overly restrictive in what you could display. This is why people rolled their own. WPF tooltips allow you to apply a templatize view with color, images, formatting, you name it. The days of rolling your own in that are mostly gone; mostly.

Custom designing of inbuilt Scroll bar or Scroll Viewer of Datagrid in Silverlight

can any one please suggest me how to change style of inbuilt scroll viewer of DataGrid in Silverlight.
Right now my DataGrid is taking the default style of scroll viewer which is used in the project so I want to change that is it possible if yes then please suggest me.
If you use Expression Blend, in design mode you can right-click the datagrid > Edit Template > Edit a Copy.
In the window "Objects and TimeLine" will appear the inbuilt components, including the Horizontal and Vertical ScrollBars:
After that, in the "Objects and TimeLine" window, you right-click the ScrollBars > Edit Template > Edit Current. The XAML Window will show the ScrollBar Style:
I recommend you mannually duplicate the entire Style and make changes in the copy.

WPF Popup and WindowsFormsHost Problem

I am hosting windowsforms control in WPF popup. Problems below:
If i make StaysOpen=False i can't interact with winform control. StaysOpen to false is required because when clicked outsidet the Popup region, it should close.
if i make StaysOpen=True i can interact with winform control but when i click outside the area of popup, it is not getting closed.
I tried setting StaysOpen=true in MouseEnter of popup and StaysOpen=False in MouseLeave, but MouseLeave fires as and when mouse is over winform control resulting in unexpected behaviour.
I even tried IsMouseCaptureWithin property of popup and found it does not work with winforms (i guess its a bug in framework).
Another problem, i was trying to close popup when root main form (which is windows form) is deactivated (pressed Alt+Tab), but this event (deactivate) is fired even when i enter into one of the controls in windowshostControl in popup.
Desired Behaviour:
should be able to host and interact with winform control in wpf popup.
on clicking on outside the area of popup, popup should close.
Appreciate any inputs.
Thanks.
I've had many problems with the defacto-standard popups in WPF, because they are in fact a new window with their own handle. This means if you drag your application around the screen, the popup stays put (it doesn't move with your window). It also means your popup has some strange behaviors and doesn't interact with your application in ways other controls normally do.
I've created 2 decorator classes to address this problem:
PopupDecorator.cs and
TimeoutPopupDecorator.cs
It's pretty simple to use:
Add a namespace declaration for the new popup classes. i.e.
xmlns:dday_wpf="clr-namespace:DDay.WPF"
Surround the area you want the popup to be able to be displayed with the decorator. i.e.
<dday_wpf:PopupDecorator x:Name="popup">
<dday_wpf:PopupDecorator.Popup>
... contents of popup go here ...
</dday_wpf:PopupDecorator.Popup>
... contents of panel go here ...
</dday_wpf:PopupDecorator>
It works pretty much identically to a normal Popup from that moment on.
This may not solve all your problems, but hopefully it helps.
This sounds a bit like my problem launching a modeless winform control from a WPF form.
Check out my question Why is my WPF textbox "kinda" readonly?.
The just being, based on what Doug said about popups being a window with its own handle, makes this applicable.

WPF changing button background color when the window is disabled

I have a button with a transparent background on a wpf window.
Problem is, when I open up another window with a .showdialog the form becomes disabled as does the button, causing the button to go white (and stick out like a sore thumb); the same happens to the listview and textbox controls. Labels and group boxes aren't impacted in this way and remain looking fine.
How do I preserve the transparency color of the button, listview and textboxes when they are disabled?
Thanks, Rob
I'm not sure what your button template looks like, I would recommend posting your XAML. But check out the MSDN Docs on Button Templating

Resources