WPF keeps only one window and displays it in the foreground

Source: Internet
Author: User

is to traverse all, some words will not be generated, no words to generate a, and the first is a parameter, and finally the window event.

changedistingwordofselected MW = NULL;
foreach (Window winIn APP. Current. Windows)
{
If (Win is changedistingwordofselected)
{
MW = win as changedistingwordofselected;
}
}
if (MW = = null)
{
MW = new changedistingwordofselected ();
Mw. Windowstartuplocation = Windowstartuplocation. Manual;
Mw. left =1025;//Location of window generation
Mw. left = Mouse. GetPosition (Globalhelper._mainwindow). X;
Mw. Top = Mouse. GetPosition (This). Y;
Mw. Show ();
}
Else
{
Mw. Visibility = System. Windows. Visibility. Visible;
Mw. topmost = True;
}

Mw. BTN_OK. Click + = delegate//to determine the replacement word
{
Listresult[currentlineindex]. Linetxtinfo[currenttxtindex]. Txtresult = MW. Changedword. Text;//Change the selected word;

observablecollection<string> strnewlinetxt = new Observablecollection<string> ();
Strnewlinetxt. Clear ();
for (int l =0; L < Listresult[currentlineindex]. Linetxtinfo.count; l++)
{
Strnewlinetxt                }
                 this                 Mw            }

< Span class= "Hljs-preprocessor" >< Span class= "hljs-comment" > < Span class= "hljs-comment" > 2, can also be a new global window object, each time checking whether the current object is empty

if (Drawingsoftware_wnd = =Null
{
Double height =This. Height;
Double width =This. Width;
Drawingsoftware_wnd =New Drawingsoftware_popup (This, height, width);
Drawingsoftware_wnd. Owner =This
}

if (!drawingsoftware_wnd. IsVisible)
{
Drawingsoftware_wnd. Show ();
This . Hide ();
}
Else
{
Drawingsoftware_wnd. Hide ();
}

WPF keeps only one window and displays it in front

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.