Solved! Go to Solution.
Hi,
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.
Here's what I've tried so far:
Protected Overrides Sub OnClick()
Dim FormLogin As New System.Windows.Forms.Form
FormLogin.Show()
End Sub
This brings up the form, but it's a completely blank form, which the form I'm attempting to call is not.
Any help is appreciated.
Thank you,
cdebruin
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
'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 Implements System.Windows.Forms.IWin32Window Private _hwnd As System.IntPtr Public ReadOnly Property Handle As System.IntPtr Implements System.Windows.Forms.IWin32Window.Handle Get Return _hwnd End Get End Property Public Sub New(ByVal Handle As System.IntPtr) _hwnd = Handle End Sub End Class