vbnow Posted December 19, 2002 Posted December 19, 2002 I'm looking to create buttons dynamically at run-time. The below code works in ASP with Web Controls. I would like use something equivalent in a windows forms application with click events working. Dim i As Integer For i = 1 To txtCreate.Text Dim objButton As HtmlButton objButton = New HtmlButton() objButton.InnerText = "button1" & i objButton.ID = "btnButtton" & i myPlace.Controls.Add(objButton) objButton.Attributes.Add("runat", "server") Next any help much appreciated! Quote
*Experts* Bucky Posted December 19, 2002 *Experts* Posted December 19, 2002 What a coincidence... I was just browsing MSDN online and I ran across this article. It doesn't show how to add event handlers, but I can tell you that you need to use the AddHandler statement and AddressOf to get the address of the sub which you want to handle the event of the buttons. http://support.microsoft.com/default.aspx?scid=KB;en-us;q308433 Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
*Experts* Volte Posted December 19, 2002 *Experts* Posted December 19, 2002 See this post from earlier today: http://www.xtremedotnettalk.com/showthread.php?s=&threadid=49741 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.