Add code during runtime

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
4 posts Page 1 of 1
Contributors
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

Add code during runtime
GoodGuy17
Hello,
First, I am using this code: viewtopic.php?f=38&t=1998
Now, I need to know how to do something like:
NewButton.Code = Textbox1.Text
I know that won't work, but I really want to know! Please somebody help me!
~GoodGuy17 :D
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Add code during runtime
mandai
Code: Select all
...

AddHandler z.Click, AddressOf oneClicked
Controls.Add(z)

..
Private Sub oneClicked(ByVal sender As System.Object, ByVal e As System.EventArgs)
  Dim cause As Button = sender
  cause.Text = Textbox1.Text
End Sub
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

Re: Add code during runtime
GoodGuy17
Im sorry, but I need to do this:
When you click a button, it adds the code in textbox1 to the created button(like a msgbox), then when you click the button, it makes a msgbox.
That's what I need.
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Add code during runtime
mandai
What do you mean by code? The event?
You can just set it with AddHandler.
4 posts Page 1 of 1
Return to “Tutorial Requests”