Modal dialog with secondary form displayed on the taskbar

I have two forms for my application that are visible on the Windows taskbar. When a modal dialogue appears in the main form, the secondary form is blocked. However, when the user clicks on the secondary form on the taskbar, he appears in a modal dialog box and is basically frozen.

Is there a way to ensure that the modal dialog does not draw under the secondary form? The topmost property is not suitable, since it relies on everything, even those that are not related to the application.

+3
source share
1 answer

Perhaps the problem is that you did not specify an owner for the dialog:

Windows, . , , , . ShowInTaskBar false.

( VB #) , , :

// defining an owner form in C#

MyForm ownedForm = new MyForm();

ownedForm.ShowInTaskbar = false;

AddOwnedForm(ownedForm);

ownedForm.Show();

, , . , .

EDIT : .NET Windows Forms . , VB.NET. , PDF, .

+4

Source: https://habr.com/ru/post/1713182/


All Articles