I am trying to make an action button without closing the form. I basically want to have a button call a function when clicked without the form closing and then from that function return a value and set the form.
Code
Set objForm = DotNetFactory.CreateInstance("System.Windows.Forms.Form", "System.Windows.Forms")
Set objRequestButton = DotNetFactory.CreateInstance("System.Windows.Forms.Button", "System.Windows.Forms")
objRequestButton.Location = DotNetFactory.CreateInstance("System.Drawing.Point", "System.Drawing", 10, 10)
objRequestButton.Width = 100
objRequestButton.Height = 20
objRequestButton.Text = "TEST BUTTON"
objForm.Controls.Add(objRequestButton)
objForm.Width = 400
objForm.Height = 400
objForm.Text = "Stand Alone"
objForm.MaximizeBox = FALSE
objForm.MinimizeBox = FALSE
objForm.StartPosition = objForm.StartPosition.CenterScreen
objForm.FormBorderStyle = objForm.FormBorderStyle.FixedSingle
result = objForm.ShowDialog()
I tried objRequestButton.OnClick(Call FunctionTest())
Anyone have an idea? This is NOT HTML