WinForms

There are 2 entries for the tag WinForms

Setting WPF Dialog owner from within WinForms application

I had some WPF dialog that I need to show from older WinForms application, or more precisely from some WinForms UserControl. The problem was to set Owner of that dialog, GetWindow() didn’t work (of course) and leaving dialog without an owner, made it possible to disappear when user switch from application to application. And I didn’t want to show it in task bar either. Thankfully, there is a very easy way, which, for some reason, I didn’t find quite fast – use WindowInteropHelper class. Here is an example: ...

When User Control or Form doesn't open in Form Editor

I was working on some project in Visual Studio 2003 with many user controls in it and suddenly, I found that I cannot open any control with Forms Editor. When I double-click on the file, it opens with CSharp code editor only. I'm still unsure how did this happen, but after looking at ".csproj" file in notepad, I have found how to fix this. Each file in .NET project is described in separate "File" node inside project file (or "Compile" node in Visual Studio 2005/2008), like in the screenshot below: Note, the SubType attribute -...