robin1974 Posted March 19, 2003 Posted March 19, 2003 Hello, I want to create a button dynamic (programmatically in VB) I can create a button in a panel dynamically in vb but I want to place the button on a certain location in the panel How do I achieve this? Quote
joteke Posted March 19, 2003 Posted March 19, 2003 Put PlaceHolder inside the Panel, where you would want to add the Button. When you create the button, add it to PlaceHolder's Controls collection Dim objButton As New Button() objHolder.Controls.Add(objButton) Quote
robin1974 Posted March 19, 2003 Author Posted March 19, 2003 ok, thanks but I don't know in advance where the button must be placed the coordinates of the button is variable can this be achieved? Quote
*Gurus* Derek Stone Posted March 19, 2003 *Gurus* Posted March 19, 2003 Set the CSS style attribute to reflect the top and left positions of the button. Button1.Attributes("style") &= "position: absolute; top: 100; left: 100;" Keep in mind this is the position of the button in its container, so to make it easier on yourself add the button to the page's control collection instead of an alternate parent element. Quote Posting Guidelines
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.