Skip to content

How to block Window interaction when another Window should have focus #8850

Answered by castorix
danielgruethling asked this question in Q&A
Discussion options

You must be logged in to vote

This seems to be exactly what I was looking for but what I don't understand is why simply setting the property throws this exception.

Ah yes, I had made a test and I had to use GWL_HWNDPARENT too (not sure if it is the best method...) :


{
    Button btn1;
    Grid grid1 = new Grid()
    {
        Background = new SolidColorBrush(Microsoft.UI.Colors.Blue),
        HorizontalAlignment = HorizontalAlignment.Stretch,
        VerticalAlignment = VerticalAlignment.Stretch,
        Children =
        {
            (btn1 = new Button()
            {
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
                C…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@danielgruethling
Comment options

Comment options

You must be logged in to vote
1 reply
@ghord
Comment options

Answer selected by danielgruethling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants