Wpf client [JDAgent table assistant] (4) win8.0 bug of the popup control, jdagentwin8.0

Source: Internet
Author: User

Wpf client [JDAgent table assistant] (4) win8.0 bug of the popup control, jdagentwin8.0

Directory region:

The self-developed wpf client has finally been completed .. Sun Exposure

Wpf client [JDAgent table assistant] development details-opening part

Wpf client [JDAgent table assistant] (1) Main Window circular menu...

Wpf client [JDAgent table assistant] development details (2) Desktop PET production details

Wpf client [JDAgent table assistant] development details (3) waterfall flow effect implementation and UI virtualization optimization Big Data Display

For the sake of beauty and flexibility when using desktop or web programs, the current programs should try to reduce the window-style interaction mode, and it is not very beautiful, unless there are too many functional content, a pop-up window will be made.

The small function points are generally made into a popup small pop-up layer which looks more beautiful, occupies a small area of the screen, and is easier to operate.

There are many good pop plug-ins in web development, such as: http://vadikom.com/demos/poshytip/

During winform development many years ago, I wanted to make this beautiful pop-up window. It is troublesome. However, the Popup control is built in wpf.

Customizable:

1. the pop-up window style (which can be a square, rounded rectangle, or even irregular image). The content of the popup control shows the shape of the content.

2. You can customize the pop-up layer closing method. By setting the Popup. StaysOpen attribute to True, it is hidden only when the Popup. IsOpen attribute is set to False in the background through code. If the set Popup. StaysOpen attribute is set to False, the Popup control disappears when you click the mouse somewhere else.

3. You can customize the position of the pop-up window by setting the position of the Popup Control

PlacementTarget = "{Binding ElementName = btnDown }"
Placement = "Top"

These two attributes are used to set the position of the popup control relative to the pop-up position of a control. The above Code sets the pop-up position to pop up on the Top of the id = btnDown button.

There are 12 Placement options in total, which are sufficient for everyone to use.

Absolute = 0,
Relative = 1,
Bottom = 2,
Center = 3,
Right = 4,
AbsolutePoint = 5,
RelativePoint = 6,
Mouse = 7,
MousePoint = 8,
Left = 9,
Top = 10,
Custom = 11,

If the location is still inaccurate, use

HorizontalOffset = "0"
VerticalOffset = "-4.

In general, the popup control designed by Microsoft developers is indeed convenient and flexible to use. There are also many applications in the project. For example:

The effect is much better than that of the pop-up window...

 

But is it that simple?

After the program is developed, we found that the popup pop-up position in win8.0 is always incorrect during multi-OS testing.

For example:

Windows right-click menu pop-up position under WinXp/Vista/Win7/Win8.1 (red circle indicates the mouse pointer position)

Windows context menu pop-up position under Win8.0 (the red circle is the mouse pointer position)

 

 

This is also the case for the Popup control. Determine the windows version in the code. The HorizontalOffset and VerticalOffset values of win8.0 popup must be adjusted.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.