static text - rounded rectangle border mfc - static

I have a static control in a dialog to show some messages in a dialog. By default it is as rectangle box. I want to make it as rounded corned rectangle to get good appearance, similar to that of a button. Any properties can be changed to make it as rounded corner rectangle

Related

Dockable Toolbar

I have an area in my application that contains toolbar, my toolbar is consist of movable canvas, that I can drag and drop it anywhere, what I want to do is to restrict the user and not allow the toolbar to be moved out of this area,
and make it dockable so I can dock it to the left, right, top and bottom of this specified area,
can anyone help me in this case?
bellow snapshot show the toolbar is highlighted by red and the restricted area is highlighted by black this area the user can't move the toolbar out
Here is the snapshot
You can reset the toolbar's position after a drag operation is completed.
First get the toolbar's coordinate which is relative to the Canvas, then translate it to coordinate relative to the bound (black area).
You can then calculate how close the toolbar's center is from each edge of the bound. If the distance is lower than a defined value, move the toolbar to the edge (to dock it), you need to rotate the toolbar 90 degrees if you dock it to the left and right edges.
Something like this.

WPF Rounded window corners with semitransparent blurred background still blur even with window transparent

I want rounded window corners (more specifically, only on the top two),
however my window background is semitransparent blurred of whatever is behind it, and I'm trying to use the usual method of having a round corner border, which works, but the window, even though transparent, still gives off a blur effect.
Here's what's happening (showing one corner)
you need to set WindowStyle to WindowStyle.None, which will remove the chrome, then you can allow transparency which is an attribute int the Window element, and set the background color to transparent. All of this can be done as attributes to the window tag.
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
To make the corners rounded, use a border and set the cornerRadius property

Crop WPF control

I have to crop some control to show only a half of it but the rest should be transparent and clickable so it is not enough to cover the control with something. The result should give a control with only half of the content (for example 50% of top) and the rest should be cropped (not hidden) so some other control below should be visible and not overlapped by cropped part. New control should also scale when window is scaled. How to do this in WPF?
I have finally did the trick using Border around the control and Clip property of this border was set to Multibinging that was generating Rectangle basing on ActualWidth and ActualHeight of my control
Maybe GridSplitter:
http://www.wpf-tutorial.com/panels/gridsplitter/
Can be used to split views horizontally/vertically, and can be responsive.

WPF control is on top of the window border, how do I stop that?

I have a WPF window and an Image in a grid in the window. I am animating the Image so it moves from out of view (beyond widow location) into the window.
The animation is nice and smooth and everything works but I notice the image is over top of the window border while it is moving. The image at the end of this question is what it looks like.
Why would the image be over top of the window border, and how do I get it to be "under" the border?
Thanks in advance!
Well after a lot of trial and error it seems the problem was the fact I was moving the image in a grid that had no defined width, so the width would expand over the border when moving the image thus extending the "client" area of the window and showing over the window area.
Once I defined a specific width of the grid, everything worked.

Showing Tooltip of WPF control under the decrative touches

I have a window with a number of controls upon it, each control with a Tooltip associated. In an effort to jazz up the window a little, I have overlayed some semi-transparent ellipses which gives the whole window a glossy finish, however, in some cases the positioning of these ellipses are preventing the hit-test getting down to my controls.
How can I have the ellipses visible, but transparent from a hit-test point-of-view?
IsHitTestVisible = false

Resources