<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: VB .NET Calling a Form in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75941#M2037</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Now is there a way to set the Form.Owner property to be the ArcMap application? This would bring the form forward if the application window is made active.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I found some documentation that shows how to do this with ArcGIS Explorer, which exposes a Application.Window reference that the Form.Owner property will accept.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, the ArcMap Application class only exposes a hWnd integer. I have no clue what to do with that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone help?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Mar 2012 23:00:22 GMT</pubDate>
    <dc:creator>JimIsbell</dc:creator>
    <dc:date>2012-03-23T23:00:22Z</dc:date>
    <item>
      <title>VB .NET Calling a Form</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75937#M2033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm in the process of converting code from VBA to VB. NET, and I'm having trouble calling a form I created from a button.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's what I've tried so far:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Protected Overrides Sub OnClick()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim FormLogin As New System.Windows.Forms.Form&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; FormLogin.Show()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This brings up the form, but it's a completely blank form, which the form I'm attempting to call is not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help is appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cdebruin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 14:01:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75937#M2033</guid>
      <dc:creator>Gregde_Bruin</dc:creator>
      <dc:date>2012-03-05T14:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: VB .NET Calling a Form</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75938#M2034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; Hi,&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;I'm in the process of converting code from VBA to VB. NET, and I'm having trouble calling a form I created from a button.&amp;nbsp; &lt;BR /&gt;Here's what I've tried so far:&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;SPAN style="color:&amp;quot;#0000FF&amp;quot;;"&gt; Protected Overrides Sub OnClick()&lt;BR /&gt;&lt;BR /&gt; Dim FormLogin As New System.Windows.Forms.Form&lt;BR /&gt; FormLogin.Show()&lt;BR /&gt;&lt;BR /&gt; End Sub&lt;/SPAN&gt; &lt;BR /&gt; &lt;BR /&gt;This brings up the form, but it's a completely blank form, which the form I'm attempting to call is not.&amp;nbsp; &lt;BR /&gt;Any help is appreciated.&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;Thank you,&amp;nbsp; &lt;BR /&gt;cdebruin&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
rem What form were you trying to create?
rem Dim FormLogin As New System.Windows.Forms.Form
Dim FormLogin As New TheActualFormIAmTryingToCreateAndNotJustANonSpecificFormObject
rem And how do I want the form to be displayed and handled 
rem FormLogin.Show() ' A floating non-modal form that can be ignored
FormLogin.ShowDialog() ' A modal form that requires the user to use it
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:56:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75938#M2034</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2021-12-10T22:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: VB .NET Calling a Form</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75939#M2035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In your VB.NET project you have defined a form class, e.g. myFormClass, that inherits or is derived from the System.Windows.Forms.Form class.&amp;nbsp; It is that form class that you have designed with various Windows Forms controls.&amp;nbsp; That is the class that you should be using when you declare your object variable FormLogin and that you set equal to a new instance of your myFormClass.&amp;nbsp; Instead you are creating an instance of the generic System.Windows.Forms.Form class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It should looks something like this in the .vb class file corresponding to your ArcMap or ArcCatalog custom button:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Protected Overrides Sub OnClick()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim FormLogin As New myFormClass&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FormLogin.Show()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There should be a myFormClass.vb class file (the form class) in your VB.NET project when you do the above code, and that form class in turn should be inheriting from the System.Windows.Forms.Form class.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 14:49:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75939#M2035</guid>
      <dc:creator>EdgarBejarano</dc:creator>
      <dc:date>2012-03-05T14:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: VB .NET Calling a Form</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75940#M2036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I see what you mean by creating instances of the generic windows form class as opposed to my own form.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I fixed the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 16:04:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75940#M2036</guid>
      <dc:creator>Gregde_Bruin</dc:creator>
      <dc:date>2012-03-05T16:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: VB .NET Calling a Form</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75941#M2037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Now is there a way to set the Form.Owner property to be the ArcMap application? This would bring the form forward if the application window is made active.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I found some documentation that shows how to do this with ArcGIS Explorer, which exposes a Application.Window reference that the Form.Owner property will accept.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, the ArcMap Application class only exposes a hWnd integer. I have no clue what to do with that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone help?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 23:00:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75941#M2037</guid>
      <dc:creator>JimIsbell</dc:creator>
      <dc:date>2012-03-23T23:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: VB .NET Calling a Form</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75942#M2038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;var parentWindow = new NEWindowsHandlerWrapper((IntPtr)_application.hWnd);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class NEWindowsHandlerWrapper : IWin32Window&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private readonly IntPtr _handle;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal NEWindowsHandlerWrapper(IntPtr handle)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(handle==IntPtr.Zero)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new ArgumentOutOfRangeException("handle", "Handle cannot be empty.");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _handle = handle;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public IntPtr Handle&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return _handle; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Mar 2012 14:56:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75942#M2038</guid>
      <dc:creator>RichardWatson</dc:creator>
      <dc:date>2012-03-24T14:56:50Z</dc:date>
    </item>
    <item>
      <title>Nice Explanation C# &amp; VB Wrapper Code</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75943#M2039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/03/23/465.aspx"&gt;http://ryanfarley.com/blog/archive/2004/03/23/465.aspx&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//00480000013m000000"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//00480000013m000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 15:10:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75943#M2039</guid>
      <dc:creator>JohnNelson3</dc:creator>
      <dc:date>2012-03-26T15:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: VB .NET Calling a Form</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75944#M2040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;@rlwatson and @jtkknelson,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the code and the links. I have it working now, thanks to helpful folks like you, here in these forums. Much appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Jim&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 20:17:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75944#M2040</guid>
      <dc:creator>JimIsbell</dc:creator>
      <dc:date>2012-03-26T20:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: VB .NET Calling a Form</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75945#M2041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;isbellj,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Would you mind posting your code showing how you accomplished this?&amp;nbsp; I can't figure it out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 18:11:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75945#M2041</guid>
      <dc:creator>KevinAndras</dc:creator>
      <dc:date>2012-04-27T18:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: VB .NET Calling a Form</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75946#M2042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's an example for my VB.NET addin. In my project, I have created the class Win32HWNDWrapper and I have a form FieldInfoForm.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
'this is the code in my main program to open the form
Dim FieldForm As New FieldInfoForm
FieldForm.ShowDialog(New Win32HWNDWrapper(My.ArcMap.Application.hWnd))

'this is the code for the Win32HWNDWrapper class
Public Class Win32HWNDWrapper

&amp;nbsp;&amp;nbsp;&amp;nbsp; Implements System.Windows.Forms.IWin32Window
&amp;nbsp;&amp;nbsp;&amp;nbsp; Private _hwnd As System.IntPtr

&amp;nbsp;&amp;nbsp;&amp;nbsp; Public ReadOnly Property Handle As System.IntPtr Implements System.Windows.Forms.IWin32Window.Handle
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return _hwnd
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Property

&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Sub New(ByVal Handle As System.IntPtr)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _hwnd = Handle
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

End Class
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:56:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75946#M2042</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-10T22:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: VB .NET Calling a Form</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75947#M2043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for that reply, &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;. That's pretty much the same code I have, and it works beautifully.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Incidentally, I discovered that this technique can also be used with a &lt;/SPAN&gt;&lt;STRONG&gt;System.Windows.Forms.MessageBox&lt;/STRONG&gt;&lt;SPAN&gt; object. As you know (or will eventually find out), the default location for the MessageBox is at the CENTER OF YOUR DISPLAY SCREEN. This behavior is not what I prefer, so I use the Win32 Window Wrapper technique, as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

Imports System.Windows.Forms


' Example 1: This will open a MessageBox at the center of YOUR FORM:
MessageBox.Show(New Win32HWNDWrapper(MyFormInstanceName.Handle), "This is the message", "This is the caption")


' Example 2: This will open a MessageBox at the center of the ARCMAP APPLICATION WINDOW:
MessageBox.Show(New Win32HWNDWrapper(My.ArcMap.Application.Hwnd), "This is the message", "This is the caption")&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope someone finds this as useful as I have.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:56:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75947#M2043</guid>
      <dc:creator>JimIsbell</dc:creator>
      <dc:date>2021-12-10T22:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: VB .NET Calling a Form</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75948#M2044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's a follow-up to the Form Owner issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I saw this demonstrated at the 2012 User Conference in San Diego using only ONE LINE OF CODE! As it turns out, .NET has a built-in static method that can do the same thing as the wrapper class mentioned earlier. It works as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MyFormInstanceName.Show(System.Windows.Forms.Control.FromHandle(My.ArcMap.Application.hWnd))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No wrapper class is needed after all!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2012 23:45:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/vb-net-calling-a-form/m-p/75948#M2044</guid>
      <dc:creator>JimIsbell</dc:creator>
      <dc:date>2012-07-30T23:45:38Z</dc:date>
    </item>
  </channel>
</rss>

