View Single Post
  #2   Report Post  
Posted to microsoft.public.dotnet.languages.csharp,microsoft.public.excel.programming,microsoft.public.office.developer.com.add_ins
XL-Dennis XL-Dennis is offline
external usenet poster
 
Posts: 4
Default Getting .NET form to respond to Excel window events

Seth,

In VB.NET the following snippet code makes the form to be part of Excel:

Dim frm As New AboutBox1
Dim appWindow As New NativeWindow

Try

appWindow.AssignHandle(Process.GetCurrentProcess() .MainWindowHandle)
frm.ShowDialog(appWindow)
Catch ex As Exception
MessageBox.Show(ex.ToString, My.Application.Info.Title.ToString)
Finally
appWindow.ReleaseHandle()
End Try


Is this what You want?

---------------
With kind regards,
Dennis
Weekly Blog .NET & Excel: http://xldennis.wordpress.com/
My English site: http://www.excelkb.com/default.aspx
My Swedish site: http://www.xldennis.com/