# .NET and More > WPF, WCF, WF >  WPF Window Form Show Top in project

## AirlineSim

vb.net Code:
Dim AGD As New MySecondForm
AGD.ShowDialog()

when i focus away from my form to say outlook then click back on my mainform it shows that and now the AGD form. that should be the topmost form on this project as it's a dislog box right? not topmost over all projects on my screen though

----------


## chris128

So are you saying that it DOESNT show your dialog form as the top form when you switch back to your program?

----------


## AirlineSim

correct when I click on MainWindow in my task bar is shows my MainWindow and not the AGD window, when I Alt + TAB I only have the option of AGD form :-)

----------


## dee-u

Try specifying the parent.


```
AGD.ShowDialog(Me)
```

----------


## chris128

I'm pretty sure I've experienced that with loads of programs and I think its more of a Windows thing than a problem with your program... but hopefully Dee-U's suggestion will help

----------


## AirlineSim

I get this error with Me

Too many arguments to 'Public Function ShowDialog() As Boolean?'

----------


## chris128

Ahh yeah I dont think WPF has that overload for the ShowDialog function (possibly something to do with the fact that it doesnt support MDI).

----------


## AirlineSim

Hmm so what to do? Do I need to declare AGD another way? DialogBox, MessageBox???

----------


## AnthonyGrimes

See this post: 

```
 http://www.vbforums.com/showthread.php?t=617790
```

----------

