Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Posted

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)

  • *Gurus*
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...