d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Vbscript Action Onclick
Add Reply New Topic New Poll
Member
Posts: 4,609
Joined: Mar 9 2008
Gold: 2,937.00
Nov 14 2013 06:47am
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
Member
Posts: 4,609
Joined: Mar 9 2008
Gold: 2,937.00
Nov 14 2013 09:50am
Trying to create a function

Code

Private Sub objRequestButton_OnClick()
'Do my Code!
End Sub


Anyone have an idea?
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll