I don’t think many people use the “AddMyButton” style, I think most use the more explicit EmbedWithin method…
[code]dim newButton as new WebButton
newButton.Top = 50
newButton.Left = 50
newButton.EmbedWithin(self, newButton.Left, newButton.Top, newButton.Width, newButton.Height)
[/code]
The first param is the view to embed the control into, hence self or me if code is running in the scope of a WebPage or WebContainer.
The way I have always one it is to create a custom control containing the button etc and then dynamically create and position the control on the page. Their is a webinar where Paul explains the multiple ways you can do this.
[quote=110915:@Ian Jones]I don’t think many people use the “AddMyButton” style, I think most use the more explicit EmbedWithin method…
[code]dim newButton as new WebButton
newButton.Top = 50
newButton.Left = 50
newButton.EmbedWithin(self, newButton.Left, newButton.Top, newButton.Width, newButton.Height)
[/code]
The first param is the view to embed the control into, hence self or me if code is running in the scope of a WebPage or WebContainer.[/quote]
Agreed - I’ve done quite a bit of this including control arrays, etc. Has worked very well for me.
AHA! I have found 2 troublesome bugs in the web edition framework which doesn’t allow controls in membersets to propertly access their names and or properties through Introspection (this includes looping through the controls by ControlAtIndex). All dynamically created elements of a memberset retain the name of their “Parent” control. All non-memberset controls do not work in their manor, nor do any non-memberset and memberset desktop controls.
Here’s two identical projects (desktop and web) that display the Web Edition MemberSet bug.
For this project, looping through each control will drastically effect the performance of the application and is very inefficient, so this bug is a “show-stopper” until it gets fixed. :-/ Not to mention the second bug which effects both Desktop and Web Edition (see picture).
Controlset arrays are improperly numbered and offset by 3…
Where
For i as integer = 0 to ControlCount -1
Listbox1.AddRow Control(i).Name
next
should be used to list all controls on the window,
For i as integer = 0 to ControlCount + 2
Listbox1.AddRow Control(i).Name
next